public abstract class LogicalNode extends TreeNode<LogicalNode>
The main validation procedure is separated into two phases:
Expressions' resolution and transformation (resolveExpressions
):
- translate UnresolvedFieldReference
into ResolvedFieldReference
using child operator's output
- translate Call
(UnresolvedFunction) into solid Expression
- generate alias names for query output
- ....
LogicalNode validation (validate
):
- check no UnresolvedFieldReference
exists any more
- check if all expressions have children of needed type
- check each logical operator have desired input
Once we pass the validation phase, we can safely convert LogicalNode into Calcite's RelNode.
Constructor and Description |
---|
LogicalNode() |
Modifier and Type | Method and Description |
---|---|
protected abstract org.apache.calcite.tools.RelBuilder |
construct(org.apache.calcite.tools.RelBuilder relBuilder) |
LogicalNode |
expressionPostOrderTransform(scala.PartialFunction<Expression,Expression> rule)
Runs
postOrderTransform with rule on all expressions present in this logical node. |
protected scala.runtime.Nothing$ |
failValidation(String msg) |
abstract scala.collection.Seq<Attribute> |
output() |
LogicalNode |
resolveExpressions(TableEnvironment tableEnv) |
scala.Option<NamedExpression> |
resolveReference(TableEnvironment tableEnv,
String name)
Resolves the given strings to a
NamedExpression using the input from all child
nodes of this LogicalPlan. |
org.apache.calcite.rel.RelNode |
toRelNode(org.apache.calcite.tools.RelBuilder relBuilder) |
LogicalNode |
validate(TableEnvironment tableEnv) |
children, fastEquals, makeCopy, postOrderTransform, preOrderVisit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public abstract scala.collection.Seq<Attribute> output()
public LogicalNode resolveExpressions(TableEnvironment tableEnv)
public final org.apache.calcite.rel.RelNode toRelNode(org.apache.calcite.tools.RelBuilder relBuilder)
protected abstract org.apache.calcite.tools.RelBuilder construct(org.apache.calcite.tools.RelBuilder relBuilder)
public LogicalNode validate(TableEnvironment tableEnv)
public scala.Option<NamedExpression> resolveReference(TableEnvironment tableEnv, String name)
NamedExpression
using the input from all child
nodes of this LogicalPlan.tableEnv
- (undocumented)name
- (undocumented)public LogicalNode expressionPostOrderTransform(scala.PartialFunction<Expression,Expression> rule)
postOrderTransform
with rule
on all expressions present in this logical node.
rule
- the rule to be applied to every expression in this logical node.protected scala.runtime.Nothing$ failValidation(String msg)
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.