Class SqlCall

    • Method Detail

      • isExpanded

        public boolean isExpanded()
        Whether this call was created by expanding a parentheses-free call to what was syntactically an identifier.
      • setOperand

        public void setOperand​(int i,
                               SqlNode operand)
        Changes the value of an operand. Allows some rewrite by SqlValidator; use sparingly.
        Parameters:
        i - Operand index
        operand - Operand value
      • getOperator

        @Nonnull
        public abstract SqlOperator getOperator()
      • getOperandList

        @Nonnull
        public abstract java.util.List<SqlNode> getOperandList()
      • operand

        public <S extends SqlNode> S operand​(int i)
      • operandCount

        public int operandCount()
      • unparse

        public void unparse​(SqlWriter writer,
                            int leftPrec,
                            int rightPrec)
        Description copied from class: SqlNode
        Writes a SQL representation of this node to a writer.

        The leftPrec and rightPrec parameters 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).

        Specified by:
        unparse in class SqlNode
        Parameters:
        writer - Target writer
        leftPrec - The precedence of the SqlNode immediately preceding this node in a depth-first scan of the parse tree
        rightPrec - The precedence of the SqlNode immediately
      • findValidOptions

        public void findValidOptions​(SqlValidator validator,
                                     SqlValidatorScope scope,
                                     SqlParserPos pos,
                                     java.util.Collection<SqlMoniker> hintList)
        Description copied from class: SqlNode
        Lists 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:
        findValidOptions in 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
      • accept

        public <R> R accept​(SqlVisitor<R> visitor)
        Description copied from class: SqlNode
        Accepts a generic visitor.

        Implementations of this method in subtypes simply call the appropriate visit method on the visitor object.

        The type parameter R must be consistent with the type parameter of the visitor.

        Specified by:
        accept in class SqlNode
      • equalsDeep

        public boolean equalsDeep​(SqlNode node,
                                  Litmus litmus)
        Description copied from class: SqlNode
        Returns 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:
        equalsDeep in class SqlNode
      • getCallSignature

        protected java.lang.String getCallSignature​(SqlValidator validator,
                                                    SqlValidatorScope scope)
        Returns a string describing the actual argument types of a call, e.g. "SUBSTR(VARCHAR(12), NUMBER(3,2), INTEGER)".
      • isCountStar

        public boolean isCountStar()
        Test to see if it is the function COUNT(*)
        Returns:
        boolean true if function call to COUNT(*)
      • getFunctionQuantifier

        public SqlLiteral getFunctionQuantifier()