Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions proto/substrait/algebra.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1753,8 +1753,14 @@ message AggregateFunction {
}
}

// This rel is used to create references,
// This rel is used to create references,
// in case we refer to a RelRoot field names will be ignored
message ReferenceRel {
int32 subtree_ordinal = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're going to do this, we should deprecate the old field, with the eventual plan of removing subtree_ordinal entirely.

And if we're going to do that, I don't know how much sense it makes to put them both in a oneof. With the way you've worded the anchor on the PlanRel, 0 isn't a valid rel anchor, so while these field coexist, if you have a ReferenceRel with subtree_reference set to 0 you know you have to use the subtree_ordinal.

// points to a PlanRel in Plan.relations by position (ordinal reference)
// This is deprecated in favor of `planrel_reference`
int32 subtree_ordinal = 1 [deprecated = true];

// points to a PlanRel in Plan.relations by use of an anchor (`reference_anchor`)
// (non-ordinal reference)
uint32 planrel_reference = 2;
}
4 changes: 4 additions & 0 deletions proto/substrait/plan.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ message PlanRel {
// The root of a relation tree
RelRoot root = 2;
}

// Provides an anchor for ReferenceRel to point to.
// A default value (0) should be considered unset.
uint32 reference_anchor = 3;
}

// Describe a set of operations to complete.
Expand Down
Loading