Class SqlCall
- All Implemented Interfaces:
- Cloneable
- Direct Known Subclasses:
- SqlAlter,- SqlAttributeDefinition,- SqlBasicCall,- SqlBegin,- SqlCase,- SqlCheckConstraint,- SqlColumnDeclaration,- SqlCommit,- SqlDdl,- SqlDelete,- SqlDescribeSchema,- SqlDescribeTable,- SqlDiscard,- SqlExplain,- SqlHint,- SqlInsert,- SqlJoin,- SqlKeyConstraint,- SqlLambda,- SqlMatchRecognize,- SqlMerge,- SqlOrderBy,- SqlPivot,- SqlRollback,- SqlSelect,- SqlShow,- SqlSnapshot,- SqlTableRef,- SqlUnpivot,- SqlUpdate,- SqlWindow,- SqlWith,- SqlWithItem
SqlCall is a call to an operator.
 (Operators can be used to describe any syntactic construct, so in practice,
 every non-leaf node in a SQL parse tree is a SqlCall of some
 kind.)- 
Field SummaryFields inherited from class org.apache.calcite.sql.SqlNodeEMPTY_ARRAY, pos
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<R> Raccept(SqlVisitor<R> visitor) Accepts a generic visitor.clone(SqlParserPos pos) Clones a SqlNode with a different position.booleanequalsDeep(@Nullable SqlNode node, Litmus litmus) Returns whether this node is structurally equivalent to another node.voidfindValidOptions(SqlValidator validator, SqlValidatorScope scope, SqlParserPos pos, Collection<SqlMoniker> hintList) Lists all the valid alternatives for this node if the parse position of the node matches that of pos.getCallSignature(SqlValidator validator, @Nullable SqlValidatorScope scope) Returns a string describing the actual argument types of a call, e.g.@Nullable SqlLiteralgetKind()Returns the type of node this is, orSqlKind.OTHERif it's nothing special.getMonotonicity(SqlValidatorScope scope) Returns whether expression is always ascending, descending or constant.Returns the list of operands.abstract SqlOperatorbooleanReturns whether it is the functionCOUNT(*).booleanWhether this call was created by expanding a parentheses-free call to what was syntactically an identifier.<S extends SqlNode>
 Soperand(int i) Returns i-th operand (0-based).intvoidsetOperand(int i, @Nullable SqlNode operand) Changes the value of an operand.voidWrites a SQL representation of this node to a writer.voidvalidate(SqlValidator validator, SqlValidatorScope scope) Validates this call.Methods inherited from class org.apache.calcite.sql.SqlNodeclone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParentheses, validateExpr
- 
Constructor Details- 
SqlCall
 
- 
- 
Method Details- 
isExpandedpublic boolean isExpanded()Whether this call was created by expanding a parentheses-free call to what was syntactically an identifier.
- 
setOperandChanges the value of an operand. Allows some rewrite bySqlValidator; use sparingly.- Parameters:
- i- Operand index
- operand- Operand value
 
- 
getKindDescription copied from class:SqlNodeReturns the type of node this is, orSqlKind.OTHERif it's nothing special.
- 
getOperator
- 
getOperandListReturns 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.- Returns:
- the list of call operands, never null, the operands can be null
 
- 
operandReturns 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.- Type Parameters:
- S- type of the result
- Parameters:
- i- operand index (0-based)
- Returns:
- i-th operand (0-based), the result might be null
 
- 
operandCountpublic int operandCount()
- 
cloneDescription copied from class:SqlNodeClones a SqlNode with a different position.
- 
unparseDescription copied from class:SqlNodeWrites a SQL representation of this node to a writer.The leftPrecandrightPrecparameters give us enough context to decide whether we need to enclose the expression in parentheses. For example, we need parentheses around "2 + 3" if preceded by "5 *". This is because the precedence of the "*" operator is greater than the precedence of the "+" operator.The algorithm handles left- and right-associative operators by giving them slightly different left- and right-precedence. If SqlWriter.isAlwaysUseParentheses()is true, we use parentheses even when they are not required by the precedence rules.For the details of this algorithm, see unparse(org.apache.calcite.sql.SqlWriter, int, int).
- 
validateValidates this call.The default implementation delegates the validation to the operator's SqlOperator.validateCall(org.apache.calcite.sql.SqlCall, org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.validate.SqlValidatorScope, org.apache.calcite.sql.validate.SqlValidatorScope). Derived classes may override (as do, for exampleSqlSelectandSqlUpdate).
- 
findValidOptionspublic void findValidOptions(SqlValidator validator, SqlValidatorScope scope, SqlParserPos pos, Collection<SqlMoniker> hintList) Description copied from class:SqlNodeLists all the valid alternatives for this node if the parse position of the node matches that of pos. Only implemented now for SqlCall and SqlOperator.- Overrides:
- findValidOptionsin class- SqlNode
- Parameters:
- validator- Validator
- scope- Validation scope
- pos- SqlParserPos indicating the cursor position at which completion hints are requested for
- hintList- list of valid options
 
- 
acceptDescription copied from class:SqlNodeAccepts a generic visitor.Implementations of this method in subtypes simply call the appropriate visitmethod on thevisitor object.The type parameter Rmust be consistent with the type parameter of the visitor.
- 
equalsDeepDescription copied from class:SqlNodeReturns whether this node is structurally equivalent to another node. Some examples:- 1 + 2 is structurally equivalent to 1 + 2
- 1 + 2 + 3 is structurally equivalent to (1 + 2) + 3, but not to 1 + (2 + 3), because the '+' operator is left-associative
 - Specified by:
- equalsDeepin class- SqlNode
 
- 
getCallSignatureReturns a string describing the actual argument types of a call, e.g. "SUBSTR(VARCHAR(12), NUMBER(3,2), INTEGER)".
- 
getMonotonicityDescription copied from class:SqlNodeReturns whether expression is always ascending, descending or constant. This property is useful because it allows to safely aggregate infinite streams of values.The default implementation returns SqlMonotonicity.NOT_MONOTONIC.- Overrides:
- getMonotonicityin class- SqlNode
- Parameters:
- scope- Scope
 
- 
isCountStarpublic boolean isCountStar()Returns whether it is the functionCOUNT(*).- Returns:
- true if function call to COUNT(*)
 
- 
getFunctionQuantifier
 
-