Package org.apache.calcite.sql
Class SqlSelectOperator
java.lang.Object
org.apache.calcite.sql.SqlOperator
org.apache.calcite.sql.SqlSelectOperator
An operator describing a query. (Not a query itself.)
Operands are:
- 0: distinct (
SqlLiteral) - 1: selectClause (
SqlNodeList) - 2: fromClause (
SqlCallto "join" operator) - 3: whereClause (
SqlNode) - 4: havingClause (
SqlNode) - 5: groupClause (
SqlNode) - 6: windowClause (
SqlNodeList) - 7: orderClause (
SqlNode)
-
Field Summary
FieldsFields inherited from class org.apache.calcite.sql.SqlOperator
kind, MDX_PRECEDENCE, NL -
Method Summary
Modifier and TypeMethodDescription<R> voidacceptCall(SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler) Accepts aSqlVisitor, directing anSqlBasicVisitor.ArgHandlerto visit an operand of a call.booleanargumentMustBeScalar(int ordinal) Returns whether theordinalth argument to this operator must be scalar (as opposed to a query).createCall(@Nullable SqlLiteral functionQualifier, SqlParserPos pos, @Nullable SqlNode... operands) Creates a call to this operator with an array of operands.createCall(SqlNodeList keywordList, SqlNodeList selectList, SqlNode fromClause, SqlNode whereClause, SqlNodeList groupBy, SqlNode having, SqlNodeList windowDecls, SqlNode qualify, SqlNodeList orderBy, SqlNode offset, SqlNode fetch, SqlNodeList hints, SqlParserPos pos) Deprecated.Returns the syntactic type of this operator, never null.voidWrites 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.SqlOperator
acceptCall, adjustType, allowsFraming, checkOperandCount, checkOperandTypes, constructArgNameList, constructArgTypeList, constructOperandList, createCall, createCall, createCall, createCall, createCall, createCall, deriveOperandType, deriveType, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getMonotonicity, getName, getNameAsId, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, getSignatureTemplate, getSqlCallFactory, getStrongPolicyInference, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isGroup, isGroupAuxiliary, isName, isSafeOperator, isSymmetrical, leftPrec, not, preValidateCall, requiresDecimalExpansion, requiresOrder, requiresOver, reverse, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperands, validRexOperands
-
Field Details
-
INSTANCE
-
-
Method Details
-
getSyntax
Description copied from class:SqlOperatorReturns the syntactic type of this operator, never null.- Specified by:
getSyntaxin classSqlOperator
-
createCall
public SqlCall createCall(@Nullable SqlLiteral functionQualifier, SqlParserPos pos, @Nullable SqlNode... operands) Description copied from class:SqlOperatorCreates a call to this operator with an array of operands.The position of the resulting call is the union of the
posand the positions of all of the operands.- Overrides:
createCallin classSqlOperator- Parameters:
functionQualifier- Function qualifier (e.g. "DISTINCT"), or nullpos- Parser position of the identifier of the calloperands- Array of operands
-
createCall
@Deprecated public SqlSelect createCall(SqlNodeList keywordList, SqlNodeList selectList, SqlNode fromClause, SqlNode whereClause, SqlNodeList groupBy, SqlNode having, SqlNodeList windowDecls, SqlNode qualify, SqlNodeList orderBy, SqlNode offset, SqlNode fetch, SqlNodeList hints, SqlParserPos pos) Deprecated.Creates a call to theSELECToperator. -
acceptCall
public <R> void acceptCall(SqlVisitor<R> visitor, SqlCall call, boolean onlyExpressions, SqlBasicVisitor.ArgHandler<R> argHandler) Description copied from class:SqlOperatorAccepts aSqlVisitor, directing anSqlBasicVisitor.ArgHandlerto visit an operand of a call.The argument handler allows fine control about how the operands are visited, and how the results are combined.
- Overrides:
acceptCallin classSqlOperator- Parameters:
visitor- Visitorcall- Call to visitonlyExpressions- If true, ignores operands which are not expressions. For example, in the call to theASoperatorargHandler- Called for each operand
-
unparse
Description copied from class:SqlOperatorWrites 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:
unparsein classSqlOperator
-
argumentMustBeScalar
public boolean argumentMustBeScalar(int ordinal) Description copied from class:SqlOperatorReturns whether theordinalth 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
SELECTandEXISTSoverride this method.- Overrides:
argumentMustBeScalarin classSqlOperator
-
createCall(SqlLiteral, SqlParserPos, SqlNode...).