diff --git a/proto/substrait/algebra.proto b/proto/substrait/algebra.proto index 8279ece67..127cd0a93 100644 --- a/proto/substrait/algebra.proto +++ b/proto/substrait/algebra.proto @@ -1633,8 +1633,12 @@ 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 { + // points to a PlanRel in Plan.relations (ordinal reference) int32 subtree_ordinal = 1; + + // points to a subtree_anchor in PlanRel (for non-ordinal reference) + uint32 subtree_reference = 2; } diff --git a/proto/substrait/plan.proto b/proto/substrait/plan.proto index e5657fb8f..768392f55 100644 --- a/proto/substrait/plan.proto +++ b/proto/substrait/plan.proto @@ -19,6 +19,9 @@ message PlanRel { // The root of a relation tree RelRoot root = 2; } + + // provides a non-ordinal anchor for ReferenceRel + uint32 subtree_anchor = 3; } // Describe a set of operations to complete.