Package org.apache.calcite.sql2rel
Interface SqlRexContext
- All Known Implementing Classes:
SqlToRelConverter.Blackboard
public interface SqlRexContext
Contains the context necessary for a
SqlRexConvertlet to convert a
SqlNode expression into a RexNode.-
Method Summary
Modifier and TypeMethodDescriptionconvertExpression(SqlNode expr) convertLiteral(SqlLiteral literal) Converts a literal.Returns the factory which supplies default values for INSERT, UPDATE, and NEW.Returns theRexBuilderto use to createRexNodeobjects.getSubQueryExpr(SqlCall call) Returns the expression used to access a given IN or EXISTSsub-query.Returns the type factory.Returns the validator.booleanIf the operator call occurs in an aggregate query, returns whether there are empty groups in the GROUP BY clause.
-
Method Details
-
convertExpression
- Parameters:
expr- Expression to translate- Returns:
- Converted expression
-
hasEmptyGroup
boolean hasEmptyGroup()If the operator call occurs in an aggregate query, returns whether there are empty groups in the GROUP BY clause. For example,SELECT count(*) FROM emp GROUP BY deptno, gender; returns false SELECT count(*) FROM emp; returns true SELECT count(*) FROM emp GROUP BY ROLLUP(deptno, gender); returns true
If the operator call occurs in window aggregate query, then returns false if the window is guaranteed to be non-empty, or true if the window might be empty.Returns false if the query is not an aggregate query.
- See Also:
-
getRexBuilder
RexBuilder getRexBuilder()Returns theRexBuilderto use to createRexNodeobjects. -
getSubQueryExpr
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
Converts a literal.
-