Package org.apache.calcite.sql2rel
Interface SqlRexContext
-
- All Known Implementing Classes:
SqlToRelConverter.Blackboard
public interface SqlRexContext
Contains the context necessary for aSqlRexConvertlet
to convert aSqlNode
expression into aRexNode
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RexNode
convertExpression(SqlNode expr)
RexNode
convertLiteral(SqlLiteral literal)
Converts a literal.int
getGroupCount()
If the operator call occurs in an aggregate query, returns the number of columns in the GROUP BY clause.InitializerExpressionFactory
getInitializerExpressionFactory()
Returns the factory which supplies default values for INSERT, UPDATE, and NEW.RexBuilder
getRexBuilder()
Returns theRexBuilder
to use to createRexNode
objects.RexRangeRef
getSubQueryExpr(SqlCall call)
Returns the expression used to access a given IN or EXISTSsub-query
.RelDataTypeFactory
getTypeFactory()
Returns the type factory.SqlValidator
getValidator()
Returns the validator.
-
-
-
Method Detail
-
convertExpression
RexNode convertExpression(SqlNode expr)
- Parameters:
expr
- Expression to translate- Returns:
- Converted expression
-
getGroupCount
int getGroupCount()
If the operator call occurs in an aggregate query, returns the number of columns in the GROUP BY clause. For example, for "SELECT count(*) FROM emp GROUP BY deptno, gender", returns 2. If the operator call occurs in window aggregate query, then returns 1 if the window is guaranteed to be non-empty, or 0 if the window might be empty.Returns 0 if the query is implicitly "GROUP BY ()" because of an aggregate expression. For example, "SELECT sum(sal) FROM emp".
Returns -1 if the query is not an aggregate query.
- Returns:
- 0 if the query is implicitly GROUP BY (), -1 if the query is not and aggregate query
- See Also:
SqlOperatorBinding.getGroupCount()
-
getRexBuilder
RexBuilder getRexBuilder()
Returns theRexBuilder
to use to createRexNode
objects.
-
getSubQueryExpr
RexRangeRef getSubQueryExpr(SqlCall call)
Returns the expression used to access a given IN or EXISTSsub-query
.- Parameters:
call
- IN or EXISTS expression- Returns:
- Expression used to access current row of sub-query
-
getTypeFactory
RelDataTypeFactory getTypeFactory()
Returns the type factory.
-
getInitializerExpressionFactory
InitializerExpressionFactory getInitializerExpressionFactory()
Returns the factory which supplies default values for INSERT, UPDATE, and NEW.
-
getValidator
SqlValidator getValidator()
Returns the validator.
-
convertLiteral
RexNode convertLiteral(SqlLiteral literal)
Converts a literal.
-
-