Package org.apache.calcite.rel.rel2sql
Class SqlImplementor.Context
- java.lang.Object
-
- org.apache.calcite.rel.rel2sql.SqlImplementor.Context
-
- Direct Known Subclasses:
SqlImplementor.BaseContext
,SqlImplementor.SimpleContext
- Enclosing class:
- SqlImplementor
public abstract static class SqlImplementor.Context extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description (package private) SqlDialect
dialect
(package private) int
fieldCount
private boolean
ignoreCast
-
Constructor Summary
Constructors Modifier Constructor Description protected
Context(SqlDialect dialect, int fieldCount)
protected
Context(SqlDialect dialect, int fieldCount, boolean ignoreCast)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) void
addOrderItem(java.util.List<SqlNode> orderByList, RelFieldCollation field)
private SqlNode
createLeftCall(SqlOperator op, java.util.List<SqlNode> nodeList)
private SqlCall
createOverCall(SqlAggFunction op, java.util.List<SqlNode> operands, SqlWindow window)
private SqlNode
createSqlWindowBound(RexWindowBound rexWindowBound)
abstract SqlNode
field(int ordinal)
java.util.List<SqlNode>
fieldList()
protected SqlImplementor.Context
getAliasContext(RexCorrelVariable variable)
SqlImplementor
implementor()
SqlNode
toSql(AggregateCall aggCall)
Converts a call to an aggregate function to an expression.SqlNode
toSql(RelFieldCollation collation)
Converts a collation to an ORDER BY item.private java.util.List<SqlNode>
toSql(RexProgram program, java.util.List<RexNode> operandList)
private SqlNode
toSql(RexProgram program, RexFieldCollation rfc)
SqlNode
toSql(RexProgram program, RexNode rex)
private SqlCall
toSql(RexProgram program, RexOver rexOver)
private SqlNode
withOrder(SqlCall call, SqlNodeList orderList)
Wraps a call in aSqlKind.WITHIN_GROUP
call, iforderList
is non-empty.
-
-
-
Field Detail
-
dialect
final SqlDialect dialect
-
fieldCount
final int fieldCount
-
ignoreCast
private final boolean ignoreCast
-
-
Constructor Detail
-
Context
protected Context(SqlDialect dialect, int fieldCount)
-
Context
protected Context(SqlDialect dialect, int fieldCount, boolean ignoreCast)
-
-
Method Detail
-
field
public abstract SqlNode field(int ordinal)
-
toSql
public SqlNode toSql(RexProgram program, RexNode rex)
- Parameters:
program
- Required only ifrex
containsRexLocalRef
rex
- Expression to convert
-
getAliasContext
protected SqlImplementor.Context getAliasContext(RexCorrelVariable variable)
-
toSql
private SqlCall toSql(RexProgram program, RexOver rexOver)
-
createOverCall
private SqlCall createOverCall(SqlAggFunction op, java.util.List<SqlNode> operands, SqlWindow window)
-
toSql
private SqlNode toSql(RexProgram program, RexFieldCollation rfc)
-
createSqlWindowBound
private SqlNode createSqlWindowBound(RexWindowBound rexWindowBound)
-
createLeftCall
private SqlNode createLeftCall(SqlOperator op, java.util.List<SqlNode> nodeList)
-
toSql
private java.util.List<SqlNode> toSql(RexProgram program, java.util.List<RexNode> operandList)
-
fieldList
public java.util.List<SqlNode> fieldList()
-
addOrderItem
void addOrderItem(java.util.List<SqlNode> orderByList, RelFieldCollation field)
-
toSql
public SqlNode toSql(AggregateCall aggCall)
Converts a call to an aggregate function to an expression.
-
withOrder
private SqlNode withOrder(SqlCall call, SqlNodeList orderList)
Wraps a call in aSqlKind.WITHIN_GROUP
call, iforderList
is non-empty.
-
toSql
public SqlNode toSql(RelFieldCollation collation)
Converts a collation to an ORDER BY item.
-
implementor
public SqlImplementor implementor()
-
-