public class RelToSqlConverter extends SqlImplementor implements ReflectiveVisitor
Modifier and Type | Class and Description |
---|---|
private static class |
RelToSqlConverter.Frame
Stack frame.
|
SqlImplementor.AliasContext, SqlImplementor.BaseContext, SqlImplementor.Builder, SqlImplementor.Clause, SqlImplementor.Context, SqlImplementor.JoinContext, SqlImplementor.MatchRecognizeContext, SqlImplementor.Result, SqlImplementor.SimpleContext
Modifier and Type | Field and Description |
---|---|
private static SqlRowOperator |
ANONYMOUS_ROW
Similar to
SqlStdOperatorTable.ROW , but does not print "ROW". |
private ReflectUtil.MethodDispatcher<SqlImplementor.Result> |
dispatcher |
private java.util.Deque<RelToSqlConverter.Frame> |
stack |
aliasSet, correlTableMap, dialect, ordinalMap, POS
Constructor and Description |
---|
RelToSqlConverter(SqlDialect dialect)
Creates a RelToSqlConverter.
|
aliasContext, convertConditionToSqlNode, isStar, isStar, joinContext, joinType, matchRecognizeContext, result, result, setOpToSql, wrapSelect
private static final SqlRowOperator ANONYMOUS_ROW
SqlStdOperatorTable.ROW
, but does not print "ROW".private final ReflectUtil.MethodDispatcher<SqlImplementor.Result> dispatcher
private final java.util.Deque<RelToSqlConverter.Frame> stack
public RelToSqlConverter(SqlDialect dialect)
protected SqlImplementor.Result dispatch(RelNode e)
visit(Xxx e)
method where Xxx
most closely matches the runtime type of the argument.public SqlImplementor.Result visitChild(int i, RelNode e)
visitChild
in class SqlImplementor
public SqlImplementor.Result visit(RelNode e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Join e)
dispatch(org.apache.calcite.rel.RelNode)
private boolean isCrossJoin(Join e)
public SqlImplementor.Result visit(Filter e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Project e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Aggregate e)
dispatch(org.apache.calcite.rel.RelNode)
private SqlImplementor.Result visitAggregate(Aggregate e, java.util.List<java.lang.Integer> groupKeyList)
private java.util.List<SqlNode> generateGroupList(SqlImplementor.Builder builder, java.util.List<SqlNode> selectList, Aggregate aggregate, java.util.List<java.lang.Integer> groupList)
GROUP BY x, y
,
GROUP BY CUBE (x, y)
or GROUP BY ROLLUP (x, y)
.
Also populates the SELECT clause. If the GROUP BY list is simple, the SELECT will be identical; if the GROUP BY list contains GROUPING SETS, CUBE or ROLLUP, the SELECT clause will contain the distinct leaf expressions.
private SqlNode groupItem(java.util.List<SqlNode> groupKeys, ImmutableBitSet groupSet, ImmutableBitSet wholeGroupSet)
public SqlImplementor.Result visit(TableScan e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Union e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Intersect e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Minus e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Calc e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Values e)
dispatch(org.apache.calcite.rel.RelNode)
public SqlImplementor.Result visit(Sort e)
dispatch(org.apache.calcite.rel.RelNode)
SqlImplementor.Result offsetFetch(Sort e, SqlImplementor.Result x)
public SqlImplementor.Result visit(TableModify modify)
dispatch(org.apache.calcite.rel.RelNode)
private SqlNodeList exprList(SqlImplementor.Context context, java.util.List<? extends RexNode> exprs)
private SqlNodeList identifierList(java.util.List<java.lang.String> names)
SqlIdentifier
s.public SqlImplementor.Result visit(Match e)
dispatch(org.apache.calcite.rel.RelNode)
public void addSelect(java.util.List<SqlNode> selectList, SqlNode node, RelDataType rowType)
addSelect
in class SqlImplementor
private void parseCorrelTable(RelNode relNode, SqlImplementor.Result x)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.