Package org.apache.calcite.rel.metadata
Interface BuiltInMetadata.ExpressionLineage
-
- All Superinterfaces:
Metadata
- All Known Subinterfaces:
BuiltInMetadata.All
- Enclosing class:
- BuiltInMetadata
public static interface BuiltInMetadata.ExpressionLineage extends Metadata
Metadata about the origins of expressions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
BuiltInMetadata.ExpressionLineage.Handler
Handler API.
-
Field Summary
Fields Modifier and Type Field Description static MetadataDef<BuiltInMetadata.ExpressionLineage>
DEF
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<RexNode>
getExpressionLineage(RexNode expression)
Given the input expression applied on the givenRelNode
, this provider returns the expression with its lineage resolved.
-
-
-
Field Detail
-
DEF
static final MetadataDef<BuiltInMetadata.ExpressionLineage> DEF
-
-
Method Detail
-
getExpressionLineage
java.util.Set<RexNode> getExpressionLineage(RexNode expression)
Given the input expression applied on the givenRelNode
, this provider returns the expression with its lineage resolved.In particular, the result will be a set of nodes which might contain references to columns in TableScan operators (
RexTableInputRef
). An expression can have more than one lineage expression due to Union operators. However, we do not check column equality in Filter predicates. Each TableScan operator below the node is identified uniquely by its qualified name and its entity number.For example, if the expression is
$0 + 2
and$0
originated from column$3
in the0
occurrence of tableA
in the plan, result will be:A.#0.$3 + 2
. Occurrences are generated in no particular order, but it is guaranteed that if two expressions referred to the same table, the qualified name + occurrence will be the same.- Parameters:
expression
- expression whose lineage we want to resolve- Returns:
- set of expressions with lineage resolved, or null if this information
cannot be determined (e.g. origin of an expression is an aggregation
in an
Aggregate
operator)
-
-