Package org.apache.calcite.sql
Class SqlUnnestOperator
- java.lang.Object
-
- org.apache.calcite.sql.SqlOperator
-
- org.apache.calcite.sql.SqlSpecialOperator
-
- org.apache.calcite.sql.SqlFunctionalOperator
-
- org.apache.calcite.sql.SqlUnnestOperator
-
public class SqlUnnestOperator extends SqlFunctionalOperator
TheUNNEST
operator.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.calcite.sql.SqlSpecialOperator
SqlSpecialOperator.ReduceResult, SqlSpecialOperator.TokenSequence
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MAP_KEY_COLUMN_NAME
static java.lang.String
MAP_VALUE_COLUMN_NAME
static java.lang.String
ORDINALITY_COLUMN_NAME
boolean
withOrdinality
WhetherWITH ORDINALITY
was specified.-
Fields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL
-
-
Constructor Summary
Constructors Constructor Description SqlUnnestOperator(boolean withOrdinality)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
argumentMustBeScalar(int ordinal)
Returns whether theordinal
th argument to this operator must be scalar (as opposed to a query).RelDataType
inferReturnType(SqlOperatorBinding opBinding)
Infers the return type of an invocation of this operator; only called after the number and types of operands have already been validated.void
unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.-
Methods inherited from class org.apache.calcite.sql.SqlSpecialOperator
getSyntax, reduceExpr
-
Methods inherited from class org.apache.calcite.sql.SqlOperator
acceptCall, acceptCall, adjustType, allowsFraming, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, deriveType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, hashCode, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, leftPrec, needsSpace, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperands, validRexOperands
-
-
-
-
Field Detail
-
withOrdinality
public final boolean withOrdinality
WhetherWITH ORDINALITY
was specified.If so, the returned records include a column
ORDINALITY
.
-
ORDINALITY_COLUMN_NAME
public static final java.lang.String ORDINALITY_COLUMN_NAME
- See Also:
- Constant Field Values
-
MAP_KEY_COLUMN_NAME
public static final java.lang.String MAP_KEY_COLUMN_NAME
- See Also:
- Constant Field Values
-
MAP_VALUE_COLUMN_NAME
public static final java.lang.String MAP_VALUE_COLUMN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
inferReturnType
public RelDataType inferReturnType(SqlOperatorBinding opBinding)
Description copied from class:SqlOperator
Infers the return type of an invocation of this operator; only called after the number and types of operands have already been validated. Subclasses must either override this method or supply an instance ofSqlReturnTypeInference
to the constructor.- Overrides:
inferReturnType
in classSqlOperator
- Parameters:
opBinding
- description of invocation (not necessarily aSqlCall
)- Returns:
- inferred return type
-
unparse
public void unparse(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
Description copied from class:SqlOperator
Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.The default implementation of this method delegates to
SqlSyntax.unparse(org.apache.calcite.sql.SqlWriter, org.apache.calcite.sql.SqlOperator, org.apache.calcite.sql.SqlCall, int, int)
.- Overrides:
unparse
in classSqlFunctionalOperator
-
argumentMustBeScalar
public boolean argumentMustBeScalar(int ordinal)
Description copied from class:SqlOperator
Returns whether theordinal
th argument to this operator must be scalar (as opposed to a query).If true (the default), the validator will attempt to convert the argument into a scalar sub-query, which must have one column and return at most one row.
Operators such as
SELECT
andEXISTS
override this method.- Overrides:
argumentMustBeScalar
in classSqlOperator
-
-