protected class SqlToRelConverter.Blackboard extends Object implements org.apache.calcite.sql2rel.SqlRexContext, org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.rex.RexNode>, org.apache.calcite.sql2rel.InitializerContext
Modifier and Type | Field and Description |
---|---|
@Nullable org.apache.calcite.rel.RelNode |
root |
@Nullable org.apache.calcite.sql.validate.SqlValidatorScope |
scope
Collection of
RelNode objects which correspond to a SELECT statement. |
Modifier | Constructor and Description |
---|---|
protected |
Blackboard(@Nullable org.apache.calcite.sql.validate.SqlValidatorScope scope,
@Nullable Map<String,org.apache.calcite.rex.RexNode> nameToNodeMap,
boolean top)
Creates a Blackboard.
|
Modifier and Type | Method and Description |
---|---|
org.apache.calcite.rex.RexNode |
convertExpression(org.apache.calcite.sql.SqlNode expr) |
org.apache.calcite.rex.RexNode |
convertInterval(org.apache.calcite.sql.SqlIntervalQualifier intervalQualifier) |
org.apache.calcite.rex.RexNode |
convertLiteral(org.apache.calcite.sql.SqlLiteral literal) |
org.apache.calcite.rex.RexFieldCollation |
convertSortExpression(org.apache.calcite.sql.SqlNode expr,
org.apache.calcite.rel.RelFieldCollation.Direction direction,
org.apache.calcite.rel.RelFieldCollation.NullDirection nullDirection)
Converts an item in an ORDER BY clause inside a window (OVER) clause, extracting DESC,
NULLS LAST and NULLS FIRST flags first.
|
void |
flatten(List<org.apache.calcite.rel.RelNode> rels,
int systemFieldCount,
int[] start,
List<org.apache.calcite.util.Pair<org.apache.calcite.rel.RelNode,Integer>> relOffsetList) |
List<org.apache.calcite.sql.validate.SqlMonotonicity> |
getColumnMonotonicities() |
int |
getGroupCount() |
org.apache.calcite.sql2rel.InitializerExpressionFactory |
getInitializerExpressionFactory() |
org.apache.calcite.rex.RexBuilder |
getRexBuilder() |
org.apache.calcite.rex.RexRangeRef |
getSubQueryExpr(org.apache.calcite.sql.SqlCall call) |
org.apache.calcite.rel.type.RelDataTypeFactory |
getTypeFactory() |
org.apache.calcite.sql.validate.SqlValidator |
getValidator() |
org.apache.calcite.rex.RexNode |
register(org.apache.calcite.rel.RelNode rel,
org.apache.calcite.rel.core.JoinRelType joinType) |
org.apache.calcite.rex.RexNode |
register(org.apache.calcite.rel.RelNode rel,
org.apache.calcite.rel.core.JoinRelType joinType,
@Nullable List<org.apache.calcite.rex.RexNode> leftKeys)
Registers a relational expression.
|
org.apache.calcite.rel.RelNode |
reRegister(org.apache.calcite.rel.RelNode root)
Re-register the
registered with given root node and return the new root node. |
org.apache.calcite.rel.RelNode |
root() |
org.apache.calcite.sql.validate.SqlValidatorScope |
scope() |
void |
setDataset(@Nullable String datasetName)
Notifies this Blackboard that the root just set using
setRoot(RelNode, boolean)
was derived using dataset substitution. |
void |
setPatternVarRef(boolean isVarRef) |
void |
setRoot(org.apache.calcite.rel.RelNode root,
boolean leaf)
Sets a new root relational expression, as the translation process backs its way further
up the tree.
|
org.apache.calcite.sql.SqlNode |
validateExpression(org.apache.calcite.rel.type.RelDataType rowType,
org.apache.calcite.sql.SqlNode expr) |
org.apache.calcite.rex.RexNode |
visit(org.apache.calcite.sql.SqlCall call) |
org.apache.calcite.rex.RexNode |
visit(org.apache.calcite.sql.SqlDataTypeSpec type) |
org.apache.calcite.rex.RexNode |
visit(org.apache.calcite.sql.SqlDynamicParam param) |
org.apache.calcite.rex.RexNode |
visit(org.apache.calcite.sql.SqlIdentifier id) |
org.apache.calcite.rex.RexNode |
visit(org.apache.calcite.sql.SqlIntervalQualifier intervalQualifier) |
org.apache.calcite.rex.RexNode |
visit(org.apache.calcite.sql.SqlLiteral literal) |
org.apache.calcite.rex.RexNode |
visit(org.apache.calcite.sql.SqlNodeList nodeList) |
public final @Nullable org.apache.calcite.sql.validate.SqlValidatorScope scope
RelNode
objects which correspond to a SELECT statement.public @Nullable org.apache.calcite.rel.RelNode root
protected Blackboard(@Nullable org.apache.calcite.sql.validate.SqlValidatorScope scope, @Nullable Map<String,org.apache.calcite.rex.RexNode> nameToNodeMap, boolean top)
scope
- Name-resolution scope for expressions validated within this query. Can be
null if this Blackboard is for a leaf node, saynameToNodeMap
- Map which translates the expression to map a given parameter into,
if translating expressions; null otherwisetop
- Whether this is the root of the querypublic org.apache.calcite.rel.RelNode root()
public org.apache.calcite.sql.validate.SqlValidatorScope scope()
public void setPatternVarRef(boolean isVarRef)
public org.apache.calcite.rex.RexNode register(org.apache.calcite.rel.RelNode rel, org.apache.calcite.rel.core.JoinRelType joinType)
public org.apache.calcite.rex.RexNode register(org.apache.calcite.rel.RelNode rel, org.apache.calcite.rel.core.JoinRelType joinType, @Nullable List<org.apache.calcite.rex.RexNode> leftKeys)
rel
- Relational expressionjoinType
- Join typeleftKeys
- LHS of IN clause, or null for expressions other than INpublic org.apache.calcite.rel.RelNode reRegister(org.apache.calcite.rel.RelNode root)
registered
with given root node and return the new root node.root
- The given root, never leafpublic void setRoot(org.apache.calcite.rel.RelNode root, boolean leaf)
root
- New root relational expressionleaf
- Whether the relational expression is a leaf, that is, derived from an atomic
relational expression such as a table name in the from clause, or the projection on
top of a select-sub-query. In particular, relational expressions derived from JOIN
operators are not leaves, but set expressions are.public void setDataset(@Nullable String datasetName)
setRoot(RelNode, boolean)
was derived using dataset substitution.
The default implementation is not interested in such notifications, and does nothing.
datasetName
- Dataset namepublic void flatten(List<org.apache.calcite.rel.RelNode> rels, int systemFieldCount, int[] start, List<org.apache.calcite.util.Pair<org.apache.calcite.rel.RelNode,Integer>> relOffsetList)
public org.apache.calcite.rex.RexNode convertExpression(org.apache.calcite.sql.SqlNode expr)
convertExpression
in interface org.apache.calcite.sql2rel.InitializerContext
convertExpression
in interface org.apache.calcite.sql2rel.SqlRexContext
public org.apache.calcite.rex.RexFieldCollation convertSortExpression(org.apache.calcite.sql.SqlNode expr, org.apache.calcite.rel.RelFieldCollation.Direction direction, org.apache.calcite.rel.RelFieldCollation.NullDirection nullDirection)
public int getGroupCount()
getGroupCount
in interface org.apache.calcite.sql2rel.SqlRexContext
public org.apache.calcite.rex.RexBuilder getRexBuilder()
getRexBuilder
in interface org.apache.calcite.sql2rel.InitializerContext
getRexBuilder
in interface org.apache.calcite.sql2rel.SqlRexContext
public org.apache.calcite.sql.SqlNode validateExpression(org.apache.calcite.rel.type.RelDataType rowType, org.apache.calcite.sql.SqlNode expr)
validateExpression
in interface org.apache.calcite.sql2rel.InitializerContext
public org.apache.calcite.rex.RexRangeRef getSubQueryExpr(org.apache.calcite.sql.SqlCall call)
getSubQueryExpr
in interface org.apache.calcite.sql2rel.SqlRexContext
public org.apache.calcite.rel.type.RelDataTypeFactory getTypeFactory()
getTypeFactory
in interface org.apache.calcite.sql2rel.SqlRexContext
public org.apache.calcite.sql2rel.InitializerExpressionFactory getInitializerExpressionFactory()
getInitializerExpressionFactory
in interface org.apache.calcite.sql2rel.SqlRexContext
public org.apache.calcite.sql.validate.SqlValidator getValidator()
getValidator
in interface org.apache.calcite.sql2rel.SqlRexContext
public org.apache.calcite.rex.RexNode convertLiteral(org.apache.calcite.sql.SqlLiteral literal)
convertLiteral
in interface org.apache.calcite.sql2rel.SqlRexContext
public org.apache.calcite.rex.RexNode convertInterval(org.apache.calcite.sql.SqlIntervalQualifier intervalQualifier)
public org.apache.calcite.rex.RexNode visit(org.apache.calcite.sql.SqlLiteral literal)
visit
in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.rex.RexNode>
public org.apache.calcite.rex.RexNode visit(org.apache.calcite.sql.SqlCall call)
visit
in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.rex.RexNode>
public org.apache.calcite.rex.RexNode visit(org.apache.calcite.sql.SqlNodeList nodeList)
visit
in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.rex.RexNode>
public org.apache.calcite.rex.RexNode visit(org.apache.calcite.sql.SqlIdentifier id)
visit
in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.rex.RexNode>
public org.apache.calcite.rex.RexNode visit(org.apache.calcite.sql.SqlDataTypeSpec type)
visit
in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.rex.RexNode>
public org.apache.calcite.rex.RexNode visit(org.apache.calcite.sql.SqlDynamicParam param)
visit
in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.rex.RexNode>
public org.apache.calcite.rex.RexNode visit(org.apache.calcite.sql.SqlIntervalQualifier intervalQualifier)
visit
in interface org.apache.calcite.sql.util.SqlVisitor<org.apache.calcite.rex.RexNode>
public List<org.apache.calcite.sql.validate.SqlMonotonicity> getColumnMonotonicities()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.