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
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContext(SqlDialect dialect, int fieldCount) protectedContext(SqlDialect dialect, int fieldCount, boolean ignoreCast) -
Method Summary
Modifier and TypeMethodDescriptionabstract SqlNodefield(int ordinal) protected SqlImplementor.ContextgetAliasContext(RexCorrelVariable variable) abstract SqlImplementororderField(int ordinal) Creates a reference to a field to be used in an ORDER BY clause.protected RexCallreverseCall(RexCall call) Reverses the order of a call, while preserving semantics, if it improves readability.toSql(AggregateCall aggCall) Converts a call to an aggregate function to an expression.toSql(Window.Group group, com.google.common.collect.ImmutableList<RexLiteral> constants, int inputFieldCount) toSql(RelFieldCollation collation) Converts a collation to an ORDER BY item.toSql(@Nullable RexProgram program, RexNode rex) toSql(RexWindowBound rexWindowBound) Converts an expression fromRexWindowBoundtoSqlNodeformat.toSql(RexWindowExclusion exclude)
-
Constructor Details
-
Context
-
Context
-
-
Method Details
-
field
-
orderField
Creates a reference to a field to be used in an ORDER BY clause.By default, it returns the same result as
field(int).If the field has an alias, uses the alias. If the field is an unqualified column reference which is the same an alias, switches to a qualified column reference.
-
toSql
- Parameters:
program- Required only ifrexcontainsRexLocalRefrex- Expression to convert
-
reverseCall
Reverses the order of a call, while preserving semantics, if it improves readability.In the base implementation, this method does nothing; in a join context, reverses a call such as "e.deptno = d.deptno" to "d.deptno = e.deptno" if "d" is the left input to the join and "e" is the right.
-
toSql
Converts an expression fromRexWindowBoundtoSqlNodeformat.- Parameters:
rexWindowBound- Expression to convert
-
toSql
-
toSql
public List<SqlNode> toSql(Window.Group group, com.google.common.collect.ImmutableList<RexLiteral> constants, int inputFieldCount) -
getAliasContext
-
fieldList
-
toSql
Converts a call to an aggregate function to an expression. -
toSql
Converts a collation to an ORDER BY item. -
implementor
-