Package org.apache.calcite.sql
Class SqlBasicCall
java.lang.Object
org.apache.calcite.sql.SqlNode
org.apache.calcite.sql.SqlCall
org.apache.calcite.sql.SqlBasicCall
- All Implemented Interfaces:
Cloneable
Implementation of
SqlCall
that keeps its operands in an array.-
Field Summary
Fields inherited from class org.apache.calcite.sql.SqlNode
EMPTY_ARRAY, pos
-
Constructor Summary
ConstructorDescriptionSqlBasicCall
(SqlOperator operator, List<? extends @Nullable SqlNode> operandList, SqlParserPos pos) Creates a SqlBasicCall.SqlBasicCall
(SqlOperator operator, List<? extends @Nullable SqlNode> operandList, SqlParserPos pos, @Nullable SqlLiteral functionQualifier) Creates a SqlBasicCall with an optional function qualifier.SqlBasicCall
(SqlOperator operator, @Nullable SqlNode[] operands, SqlParserPos pos) Deprecated.SqlBasicCall
(SqlOperator operator, @Nullable SqlNode[] operands, SqlParserPos pos, @Nullable SqlLiteral functionQualifier) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionclone
(SqlParserPos pos) Clones a SqlNode with a different position.@Nullable SqlLiteral
getKind()
Returns the type of node this is, orSqlKind.OTHER
if it's nothing special.Returns the list of operands.<S extends SqlNode>
Soperand
(int i) Returns i-th operand (0-based).int
void
setOperand
(int i, @Nullable SqlNode operand) Changes the value of an operand.void
setOperator
(SqlOperator operator) Sets the operator (or function) that is being called.withExpanded
(boolean expanded) Sets whether this call is expanded.Methods inherited from class org.apache.calcite.sql.SqlCall
accept, equalsDeep, findValidOptions, getCallSignature, getMonotonicity, isCountStar, isExpanded, unparse, validate
Methods inherited from class org.apache.calcite.sql.SqlNode
clone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExpr
-
Constructor Details
-
SqlBasicCall
@Deprecated public SqlBasicCall(SqlOperator operator, @Nullable SqlNode[] operands, SqlParserPos pos) Deprecated. -
SqlBasicCall
public SqlBasicCall(SqlOperator operator, List<? extends @Nullable SqlNode> operandList, SqlParserPos pos) Creates a SqlBasicCall.It is not expanded; call
withExpanded(true)
to expand. -
SqlBasicCall
@Deprecated public SqlBasicCall(SqlOperator operator, @Nullable SqlNode[] operands, SqlParserPos pos, @Nullable SqlLiteral functionQualifier) Deprecated. -
SqlBasicCall
public SqlBasicCall(SqlOperator operator, List<? extends @Nullable SqlNode> operandList, SqlParserPos pos, @Nullable SqlLiteral functionQualifier) Creates a SqlBasicCall with an optional function qualifier.It is not expanded; call
withExpanded(true)
to expand.
-
-
Method Details
-
getKind
Description copied from class:SqlNode
Returns the type of node this is, orSqlKind.OTHER
if it's nothing special. -
withExpanded
Sets whether this call is expanded.- See Also:
-
setOperand
Description copied from class:SqlCall
Changes the value of an operand. Allows some rewrite bySqlValidator
; use sparingly.- Overrides:
setOperand
in classSqlCall
- Parameters:
i
- Operand indexoperand
- Operand value
-
setOperator
Sets the operator (or function) that is being called.This method is used by the validator to set a more refined version of the same operator (for instance, a version where overloading has been resolved); use with care.
-
getOperator
- Specified by:
getOperator
in classSqlCall
-
getOperandList
Description copied from class:SqlCall
Returns the list of operands. The set and order of operands is call-specific.Note: the proper type would be
List<@Nullable SqlNode>
, however, it would trigger too many changes to the current codebase.- Specified by:
getOperandList
in classSqlCall
- Returns:
- the list of call operands, never null, the operands can be null
-
operand
Description copied from class:SqlCall
Returns i-th operand (0-based).Note: the result might be null, so the proper signature would be
<S extends @Nullable SqlNode>
, however, it would trigger to many changes to the current codebase. -
operandCount
public int operandCount()- Overrides:
operandCount
in classSqlCall
-
getFunctionQuantifier
- Overrides:
getFunctionQuantifier
in classSqlCall
-
clone
Description copied from class:SqlNode
Clones a SqlNode with a different position.
-