Class SqlSelectOperator

    • Constructor Detail

      • SqlSelectOperator

        private SqlSelectOperator()
    • Method Detail

      • createCall

        public SqlCall createCall​(SqlLiteral functionQualifier,
                                  SqlParserPos pos,
                                  SqlNode... operands)
        Description copied from class: SqlOperator
        Creates a call to this operand with an array of operands.

        The position of the resulting call is the union of the pos and the positions of all of the operands.

        Overrides:
        createCall in class SqlOperator
        Parameters:
        functionQualifier - function qualifier (e.g. "DISTINCT"), may be
        pos - parser position of the identifier of the call
        operands - array of operands
      • createCall

        public SqlSelect createCall​(SqlNodeList keywordList,
                                    SqlNodeList selectList,
                                    SqlNode fromClause,
                                    SqlNode whereClause,
                                    SqlNodeList groupBy,
                                    SqlNode having,
                                    SqlNodeList windowDecls,
                                    SqlNodeList orderBy,
                                    SqlNode offset,
                                    SqlNode fetch,
                                    SqlParserPos pos)
        Creates a call to the SELECT operator.
        Parameters:
        keywordList - List of keywords such DISTINCT and ALL, or null
        selectList - The SELECT clause, or null if empty
        fromClause - The FROM clause
        whereClause - The WHERE clause, or null if not present
        groupBy - The GROUP BY clause, or null if not present
        having - The HAVING clause, or null if not present
        windowDecls - The WINDOW clause, or null if not present
        orderBy - The ORDER BY clause, or null if not present
        offset - Expression for number of rows to discard before returning first row
        fetch - Expression for number of rows to fetch
        pos - The parser position, or SqlParserPos.ZERO if not specified; must not be null.
        Returns:
        A SqlSelect, never null
      • acceptCall

        public <R> void acceptCall​(SqlVisitor<R> visitor,
                                   SqlCall call,
                                   boolean onlyExpressions,
                                   SqlBasicVisitor.ArgHandler<R> argHandler)
        Description copied from class: SqlOperator
        Accepts a SqlVisitor, directing an SqlBasicVisitor.ArgHandler to 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:
        acceptCall in class SqlOperator
        Parameters:
        visitor - Visitor
        call - Call to visit
        onlyExpressions - If true, ignores operands which are not expressions. For example, in the call to the AS operator
        argHandler - Called for each operand
      • argumentMustBeScalar

        public boolean argumentMustBeScalar​(int ordinal)
        Description copied from class: SqlOperator
        Returns whether the ordinalth 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 and EXISTS override this method.

        Overrides:
        argumentMustBeScalar in class SqlOperator