Skip to content

Commit

Permalink
feat: allow naming/aliasing relations (#649)
Browse files Browse the repository at this point in the history
Same goal as in #648 - to support what Spark's and DataFusion's
SubqueryAlias relation does.

As Substrait mostly only referes to columns by their index, there is no
inherent need for table name/qualifiers within Substrait. However, some
consumers, e.g. DataFusion, require column names to be either unique or
qualified for joins, which is troublesome w/o the possibility to qualify
relations.

Also, for debugging failed plans and for roundtrip testing of X ->
Substrait -> X conversions, it would be convenient to have proper,
human-readable names to refer to.

Closes #571
  • Loading branch information
Blizzara authored Jul 3, 2024
1 parent 95bc6ba commit 4cf8108
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions proto/substrait/algebra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ message RelCommon {
message Hint {
Stats stats = 1;
RuntimeConstraint constraint = 2;

// Name (alias) for this relation. Can be used for e.g. qualifying the relation (see e.g.
// Spark's SubqueryAlias), or debugging.
string alias = 3;

substrait.extensions.AdvancedExtension advanced_extension = 10;

// The statistics related to a hint (physical properties of records)
Expand Down

0 comments on commit 4cf8108

Please sign in to comment.