Enum SqlKind

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SqlKind>

    public enum SqlKind
    extends java.lang.Enum<SqlKind>
    Enumerates the possible types of SqlNode.

    The values are immutable, canonical constants, so you can use Kinds to find particular types of expressions quickly. To identity a call to a common operator such as '=', use SqlNode.isA(java.util.Set<org.apache.calcite.sql.SqlKind>):

    exp.isA(EQUALS)

    Only commonly-used nodes have their own type; other nodes are of type OTHER. Some of the values, such as SET_QUERY, represent aggregates.

    To quickly choose between a number of options, use a switch statement:

    switch (exp.getKind()) {
     case EQUALS:
         ...;
     case NOT_EQUALS:
         ...;
     default:
         throw new AssertionError("unexpected");
     }

    Note that we do not even have to check that a SqlNode is a SqlCall.

    To identify a category of expressions, use SqlNode.isA with an aggregate SqlKind. The following expression will return true for calls to '=' and '>=', but false for the constant '5', or a call to '+':

    exp.isA(SqlKind.COMPARISON)

    RexNode also has a getKind method; SqlKind values are preserved during translation from SqlNode to RexNode, where applicable.

    There is no water-tight definition of "common", but that's OK. There will always be operators that don't have their own kind, and for these we use the SqlOperator. But for really the common ones, e.g. the many places where we are looking for AND, OR and EQUALS, the enum helps.

    (If we were using Scala, SqlOperator would be a case class, and we wouldn't need SqlKind. But we're not.)

    • Enum Constant Detail

      • SELECT

        public static final SqlKind SELECT
        SELECT statement or sub-query.
      • JOIN

        public static final SqlKind JOIN
        JOIN operator or compound FROM clause.

        A FROM clause with more than one table is represented as if it were a join. For example, "FROM x, y, z" is represented as "JOIN(x, JOIN(x, y))".

      • IDENTIFIER

        public static final SqlKind IDENTIFIER
        Identifier
      • LITERAL

        public static final SqlKind LITERAL
        A literal.
      • OTHER_FUNCTION

        public static final SqlKind OTHER_FUNCTION
        Function that is not a special function.
        See Also:
        FUNCTION
      • POSITION

        public static final SqlKind POSITION
        POSITION Function
      • EXPLAIN

        public static final SqlKind EXPLAIN
        EXPLAIN statement
      • DESCRIBE_SCHEMA

        public static final SqlKind DESCRIBE_SCHEMA
        DESCRIBE SCHEMA statement
      • DESCRIBE_TABLE

        public static final SqlKind DESCRIBE_TABLE
        DESCRIBE TABLE statement
      • INSERT

        public static final SqlKind INSERT
        INSERT statement
      • DELETE

        public static final SqlKind DELETE
        DELETE statement
      • UPDATE

        public static final SqlKind UPDATE
        UPDATE statement
      • SET_OPTION

        public static final SqlKind SET_OPTION
        "ALTER scope SET option = value" statement.
      • DYNAMIC_PARAM

        public static final SqlKind DYNAMIC_PARAM
        A dynamic parameter.
      • WITH

        public static final SqlKind WITH
        WITH clause.
      • WITH_ITEM

        public static final SqlKind WITH_ITEM
        Item in WITH clause.
      • UNION

        public static final SqlKind UNION
        Union
      • EXCEPT

        public static final SqlKind EXCEPT
        Except
      • INTERSECT

        public static final SqlKind INTERSECT
        Intersect
      • AS

        public static final SqlKind AS
        AS operator
      • ARGUMENT_ASSIGNMENT

        public static final SqlKind ARGUMENT_ASSIGNMENT
        ARGUMENT_ASSIGNMENT operator, =>
      • DEFAULT

        public static final SqlKind DEFAULT
        DEFAULT operator
      • OVER

        public static final SqlKind OVER
        OVER operator
      • RESPECT_NULLS

        public static final SqlKind RESPECT_NULLS
        RESPECT NULLS operator
      • IGNORE_NULLS

        public static final SqlKind IGNORE_NULLS
        IGNORE NULLS operator
      • FILTER

        public static final SqlKind FILTER
        FILTER operator
      • WITHIN_GROUP

        public static final SqlKind WITHIN_GROUP
        WITHIN_GROUP operator
      • WINDOW

        public static final SqlKind WINDOW
        Window specification
      • MERGE

        public static final SqlKind MERGE
        MERGE statement
      • TABLESAMPLE

        public static final SqlKind TABLESAMPLE
        TABLESAMPLE operator
      • MATCH_RECOGNIZE

        public static final SqlKind MATCH_RECOGNIZE
        MATCH_RECOGNIZE clause
      • SNAPSHOT

        public static final SqlKind SNAPSHOT
        SNAPSHOT operator
      • TIMES

        public static final SqlKind TIMES
        The arithmetic multiplication operator, "*".
      • DIVIDE

        public static final SqlKind DIVIDE
        The arithmetic division operator, "/".
      • MOD

        public static final SqlKind MOD
        The arithmetic remainder operator, "MOD" (and "%" in some dialects).
      • PLUS

        public static final SqlKind PLUS
        The arithmetic plus operator, "+".
        See Also:
        PLUS_PREFIX
      • MINUS

        public static final SqlKind MINUS
        The arithmetic minus operator, "-".
        See Also:
        MINUS_PREFIX
      • PATTERN_ALTER

        public static final SqlKind PATTERN_ALTER
        the alternation operator in a pattern expression within a match_recognize clause
      • PATTERN_CONCAT

        public static final SqlKind PATTERN_CONCAT
        the concatenation operator in a pattern expression within a match_recognize clause
      • IN

        public static final SqlKind IN
        The "IN" operator.
      • NOT_IN

        public static final SqlKind NOT_IN
        The "NOT IN" operator.

        Only occurs in SqlNode trees. Is expanded to NOT(IN ...) before entering RelNode land.

      • LESS_THAN

        public static final SqlKind LESS_THAN
        The less-than operator, "<".
      • GREATER_THAN

        public static final SqlKind GREATER_THAN
        The greater-than operator, ">".
      • LESS_THAN_OR_EQUAL

        public static final SqlKind LESS_THAN_OR_EQUAL
        The less-than-or-equal operator, "<=".
      • GREATER_THAN_OR_EQUAL

        public static final SqlKind GREATER_THAN_OR_EQUAL
        The greater-than-or-equal operator, ">=".
      • EQUALS

        public static final SqlKind EQUALS
        The equals operator, "=".
      • NOT_EQUALS

        public static final SqlKind NOT_EQUALS
        The not-equals operator, "!=" or "<>". The latter is standard, and preferred.
      • IS_DISTINCT_FROM

        public static final SqlKind IS_DISTINCT_FROM
        The is-distinct-from operator.
      • IS_NOT_DISTINCT_FROM

        public static final SqlKind IS_NOT_DISTINCT_FROM
        The is-not-distinct-from operator.
      • OR

        public static final SqlKind OR
        The logical "OR" operator.
      • AND

        public static final SqlKind AND
        The logical "AND" operator.
      • DOT

        public static final SqlKind DOT
        Dot
      • OVERLAPS

        public static final SqlKind OVERLAPS
        The "OVERLAPS" operator for periods.
      • CONTAINS

        public static final SqlKind CONTAINS
        The "CONTAINS" operator for periods.
      • PRECEDES

        public static final SqlKind PRECEDES
        The "PRECEDES" operator for periods.
      • IMMEDIATELY_PRECEDES

        public static final SqlKind IMMEDIATELY_PRECEDES
        The "IMMEDIATELY PRECEDES" operator for periods.
      • SUCCEEDS

        public static final SqlKind SUCCEEDS
        The "SUCCEEDS" operator for periods.
      • IMMEDIATELY_SUCCEEDS

        public static final SqlKind IMMEDIATELY_SUCCEEDS
        The "IMMEDIATELY SUCCEEDS" operator for periods.
      • PERIOD_EQUALS

        public static final SqlKind PERIOD_EQUALS
        The "EQUALS" operator for periods.
      • LIKE

        public static final SqlKind LIKE
        The "LIKE" operator.
      • SIMILAR

        public static final SqlKind SIMILAR
        The "SIMILAR" operator.
      • BETWEEN

        public static final SqlKind BETWEEN
        The "BETWEEN" operator.
      • CASE

        public static final SqlKind CASE
        A "CASE" expression.
      • NULLIF

        public static final SqlKind NULLIF
        The "NULLIF" operator.
      • COALESCE

        public static final SqlKind COALESCE
        The "COALESCE" operator.
      • DECODE

        public static final SqlKind DECODE
        The "DECODE" function (Oracle).
      • NVL

        public static final SqlKind NVL
        The "NVL" function (Oracle).
      • GREATEST

        public static final SqlKind GREATEST
        The "GREATEST" function (Oracle).
      • LEAST

        public static final SqlKind LEAST
        The "LEAST" function (Oracle).
      • TIMESTAMP_ADD

        public static final SqlKind TIMESTAMP_ADD
        The "TIMESTAMP_ADD" function (ODBC, SQL Server, MySQL).
      • TIMESTAMP_DIFF

        public static final SqlKind TIMESTAMP_DIFF
        The "TIMESTAMP_DIFF" function (ODBC, SQL Server, MySQL).
      • NOT

        public static final SqlKind NOT
        The logical "NOT" operator.
      • PLUS_PREFIX

        public static final SqlKind PLUS_PREFIX
        The unary plus operator, as in "+1".
        See Also:
        PLUS
      • MINUS_PREFIX

        public static final SqlKind MINUS_PREFIX
        The unary minus operator, as in "-1".
        See Also:
        MINUS
      • EXISTS

        public static final SqlKind EXISTS
        The "EXISTS" operator.
      • SOME

        public static final SqlKind SOME
        The "SOME" quantification operator (also called "ANY").
      • ALL

        public static final SqlKind ALL
        The "ALL" quantification operator.
      • VALUES

        public static final SqlKind VALUES
        The "VALUES" operator.
      • EXPLICIT_TABLE

        public static final SqlKind EXPLICIT_TABLE
        Explicit table, e.g. select * from (TABLE t) or TABLE t. See also COLLECTION_TABLE.
      • SCALAR_QUERY

        public static final SqlKind SCALAR_QUERY
        Scalar query; that is, a sub-query used in an expression context, and returning one row and one column.
      • PROCEDURE_CALL

        public static final SqlKind PROCEDURE_CALL
        ProcedureCall
      • NEW_SPECIFICATION

        public static final SqlKind NEW_SPECIFICATION
        NewSpecification
      • FINAL

        public static final SqlKind FINAL
        Special functions in MATCH_RECOGNIZE.
      • RUNNING

        public static final SqlKind RUNNING
      • PREV

        public static final SqlKind PREV
      • NEXT

        public static final SqlKind NEXT
      • FIRST

        public static final SqlKind FIRST
      • LAST

        public static final SqlKind LAST
      • CLASSIFIER

        public static final SqlKind CLASSIFIER
      • MATCH_NUMBER

        public static final SqlKind MATCH_NUMBER
      • SKIP_TO_FIRST

        public static final SqlKind SKIP_TO_FIRST
        The "SKIP TO FIRST" qualifier of restarting point in a MATCH_RECOGNIZE clause.
      • SKIP_TO_LAST

        public static final SqlKind SKIP_TO_LAST
        The "SKIP TO LAST" qualifier of restarting point in a MATCH_RECOGNIZE clause.
      • DESCENDING

        public static final SqlKind DESCENDING
        DESC in ORDER BY. A parse tree, not a true expression.
      • NULLS_FIRST

        public static final SqlKind NULLS_FIRST
        NULLS FIRST clause in ORDER BY. A parse tree, not a true expression.
      • NULLS_LAST

        public static final SqlKind NULLS_LAST
        NULLS LAST clause in ORDER BY. A parse tree, not a true expression.
      • IS_TRUE

        public static final SqlKind IS_TRUE
        The "IS TRUE" operator.
      • IS_FALSE

        public static final SqlKind IS_FALSE
        The "IS FALSE" operator.
      • IS_NOT_TRUE

        public static final SqlKind IS_NOT_TRUE
        The "IS NOT TRUE" operator.
      • IS_NOT_FALSE

        public static final SqlKind IS_NOT_FALSE
        The "IS NOT FALSE" operator.
      • IS_UNKNOWN

        public static final SqlKind IS_UNKNOWN
        The "IS UNKNOWN" operator.
      • IS_NULL

        public static final SqlKind IS_NULL
        The "IS NULL" operator.
      • IS_NOT_NULL

        public static final SqlKind IS_NOT_NULL
        The "IS NOT NULL" operator.
      • PRECEDING

        public static final SqlKind PRECEDING
        The "PRECEDING" qualifier of an interval end-point in a window specification.
      • FOLLOWING

        public static final SqlKind FOLLOWING
        The "FOLLOWING" qualifier of an interval end-point in a window specification.
      • FIELD_ACCESS

        public static final SqlKind FIELD_ACCESS
        The field access operator, ".".

        (Only used at the RexNode level; at SqlNode level, a field-access is part of an identifier.)

      • INPUT_REF

        public static final SqlKind INPUT_REF
        Reference to an input field.

        (Only used at the RexNode level.)

      • TABLE_INPUT_REF

        public static final SqlKind TABLE_INPUT_REF
        Reference to an input field, with a qualified name and an identifier

        (Only used at the RexNode level.)

      • PATTERN_INPUT_REF

        public static final SqlKind PATTERN_INPUT_REF
        Reference to an input field, with pattern var as modifier

        (Only used at the RexNode level.)

      • LOCAL_REF

        public static final SqlKind LOCAL_REF
        Reference to a sub-expression computed within the current relational operator.

        (Only used at the RexNode level.)

      • CORREL_VARIABLE

        public static final SqlKind CORREL_VARIABLE
        Reference to correlation variable.

        (Only used at the RexNode level.)

      • PATTERN_QUANTIFIER

        public static final SqlKind PATTERN_QUANTIFIER
        the repetition quantifier of a pattern factor in a match_recognize clause.
      • ROW

        public static final SqlKind ROW
        The row-constructor function. May be explicit or implicit: VALUES 1, ROW (2).
      • COLUMN_LIST

        public static final SqlKind COLUMN_LIST
        The non-standard constructor used to pass a COLUMN_LIST parameter to a user-defined transform.
      • CAST

        public static final SqlKind CAST
        The "CAST" operator.
      • NEXT_VALUE

        public static final SqlKind NEXT_VALUE
        The "NEXT VALUE OF sequence" operator.
      • CURRENT_VALUE

        public static final SqlKind CURRENT_VALUE
        The "CURRENT VALUE OF sequence" operator.
      • FLOOR

        public static final SqlKind FLOOR
        The "FLOOR" function
      • CEIL

        public static final SqlKind CEIL
        The "CEIL" function
      • TRIM

        public static final SqlKind TRIM
        The "TRIM" function.
      • LTRIM

        public static final SqlKind LTRIM
        The "LTRIM" function (Oracle).
      • RTRIM

        public static final SqlKind RTRIM
        The "RTRIM" function (Oracle).
      • EXTRACT

        public static final SqlKind EXTRACT
        The "EXTRACT" function.
      • REVERSE

        public static final SqlKind REVERSE
        The "REVERSE" function (SQL Server, MySQL).
      • JDBC_FN

        public static final SqlKind JDBC_FN
        Call to a function using JDBC function syntax.
      • MULTISET_VALUE_CONSTRUCTOR

        public static final SqlKind MULTISET_VALUE_CONSTRUCTOR
        The MULTISET value constructor.
      • MULTISET_QUERY_CONSTRUCTOR

        public static final SqlKind MULTISET_QUERY_CONSTRUCTOR
        The MULTISET query constructor.
      • JSON_VALUE_EXPRESSION

        public static final SqlKind JSON_VALUE_EXPRESSION
        The JSON value expression.
      • JSON_ARRAYAGG

        public static final SqlKind JSON_ARRAYAGG
        The JSON_ARRAYAGG aggregate function.
      • JSON_OBJECTAGG

        public static final SqlKind JSON_OBJECTAGG
        The JSON_OBJECTAGG aggregate function.
      • UNNEST

        public static final SqlKind UNNEST
        The "UNNEST" operator.
      • LATERAL

        public static final SqlKind LATERAL
        The "LATERAL" qualifier to relations in the FROM clause.
      • COLLECTION_TABLE

        public static final SqlKind COLLECTION_TABLE
        Table operator which converts user-defined transform into a relation, for example, select * from TABLE(udx(x, y, z)). See also the EXPLICIT_TABLE prefix operator.
      • ARRAY_VALUE_CONSTRUCTOR

        public static final SqlKind ARRAY_VALUE_CONSTRUCTOR
        Array Value Constructor, e.g. Array[1, 2, 3].
      • ARRAY_QUERY_CONSTRUCTOR

        public static final SqlKind ARRAY_QUERY_CONSTRUCTOR
        Array Query Constructor, e.g. Array(select deptno from dept).
      • MAP_VALUE_CONSTRUCTOR

        public static final SqlKind MAP_VALUE_CONSTRUCTOR
        Map Value Constructor, e.g. Map['washington', 1, 'obama', 44].
      • MAP_QUERY_CONSTRUCTOR

        public static final SqlKind MAP_QUERY_CONSTRUCTOR
        Map Query Constructor, e.g. MAP (SELECT empno, deptno FROM emp).
      • CURSOR

        public static final SqlKind CURSOR
        CURSOR constructor, for example, select * from TABLE(udx(CURSOR(select ...), x, y, z))
      • LITERAL_CHAIN

        public static final SqlKind LITERAL_CHAIN
        Literal chain operator (for composite string literals). An internal operator that does not appear in SQL syntax.
      • ESCAPE

        public static final SqlKind ESCAPE
        Escape operator (always part of LIKE or SIMILAR TO expression). An internal operator that does not appear in SQL syntax.
      • REINTERPRET

        public static final SqlKind REINTERPRET
        The internal REINTERPRET operator (meaning a reinterpret cast). An internal operator that does not appear in SQL syntax.
      • EXTEND

        public static final SqlKind EXTEND
        The internal EXTEND operator that qualifies a table name in the FROM clause.
      • CUBE

        public static final SqlKind CUBE
        The internal CUBE operator that occurs within a GROUP BY clause.
      • ROLLUP

        public static final SqlKind ROLLUP
        The internal ROLLUP operator that occurs within a GROUP BY clause.
      • GROUPING_SETS

        public static final SqlKind GROUPING_SETS
        The internal GROUPING SETS operator that occurs within a GROUP BY clause.
      • GROUPING

        public static final SqlKind GROUPING
        The GROUPING(e, ...) function.
      • GROUPING_ID

        @Deprecated
        public static final SqlKind GROUPING_ID
        Deprecated.
      • GROUP_ID

        public static final SqlKind GROUP_ID
        The GROUP_ID() function.
      • PATTERN_PERMUTE

        public static final SqlKind PATTERN_PERMUTE
        The internal "permute" function in a MATCH_RECOGNIZE clause.
      • PATTERN_EXCLUDED

        public static final SqlKind PATTERN_EXCLUDED
        The special patterns to exclude enclosing pattern from output in a MATCH_RECOGNIZE clause.
      • COUNT

        public static final SqlKind COUNT
        The COUNT aggregate function.
      • SUM

        public static final SqlKind SUM
        The SUM aggregate function.
      • SUM0

        public static final SqlKind SUM0
        The SUM0 aggregate function.
      • MIN

        public static final SqlKind MIN
        The MIN aggregate function.
      • MAX

        public static final SqlKind MAX
        The MAX aggregate function.
      • LEAD

        public static final SqlKind LEAD
        The LEAD aggregate function.
      • LAG

        public static final SqlKind LAG
        The LAG aggregate function.
      • FIRST_VALUE

        public static final SqlKind FIRST_VALUE
        The FIRST_VALUE aggregate function.
      • LAST_VALUE

        public static final SqlKind LAST_VALUE
        The LAST_VALUE aggregate function.
      • ANY_VALUE

        public static final SqlKind ANY_VALUE
        The ANY_VALUE aggregate function.
      • COVAR_POP

        public static final SqlKind COVAR_POP
        The COVAR_POP aggregate function.
      • COVAR_SAMP

        public static final SqlKind COVAR_SAMP
        The COVAR_SAMP aggregate function.
      • REGR_COUNT

        public static final SqlKind REGR_COUNT
        The REGR_COUNT aggregate function.
      • REGR_SXX

        public static final SqlKind REGR_SXX
        The REGR_SXX aggregate function.
      • REGR_SYY

        public static final SqlKind REGR_SYY
        The REGR_SYY aggregate function.
      • AVG

        public static final SqlKind AVG
        The AVG aggregate function.
      • STDDEV_POP

        public static final SqlKind STDDEV_POP
        The STDDEV_POP aggregate function.
      • STDDEV_SAMP

        public static final SqlKind STDDEV_SAMP
        The STDDEV_SAMP aggregate function.
      • VAR_POP

        public static final SqlKind VAR_POP
        The VAR_POP aggregate function.
      • VAR_SAMP

        public static final SqlKind VAR_SAMP
        The VAR_SAMP aggregate function.
      • NTILE

        public static final SqlKind NTILE
        The NTILE aggregate function.
      • NTH_VALUE

        public static final SqlKind NTH_VALUE
        The NTH_VALUE aggregate function.
      • LISTAGG

        public static final SqlKind LISTAGG
        The LISTAGG aggregate function.
      • COLLECT

        public static final SqlKind COLLECT
        The COLLECT aggregate function.
      • FUSION

        public static final SqlKind FUSION
        The FUSION aggregate function.
      • SINGLE_VALUE

        public static final SqlKind SINGLE_VALUE
        The SINGLE_VALUE aggregate function.
      • BIT_AND

        public static final SqlKind BIT_AND
        The BIT_AND aggregate function.
      • BIT_OR

        public static final SqlKind BIT_OR
        The BIT_OR aggregate function.
      • ROW_NUMBER

        public static final SqlKind ROW_NUMBER
        The ROW_NUMBER window function.
      • RANK

        public static final SqlKind RANK
        The RANK window function.
      • PERCENT_RANK

        public static final SqlKind PERCENT_RANK
        The PERCENT_RANK window function.
      • DENSE_RANK

        public static final SqlKind DENSE_RANK
        The DENSE_RANK window function.
      • CUME_DIST

        public static final SqlKind CUME_DIST
        The ROW_NUMBER window function.
      • TUMBLE

        public static final SqlKind TUMBLE
        The TUMBLE group function.
      • TUMBLE_START

        public static final SqlKind TUMBLE_START
        The TUMBLE_START auxiliary function of the TUMBLE group function.
      • TUMBLE_END

        public static final SqlKind TUMBLE_END
        The TUMBLE_END auxiliary function of the TUMBLE group function.
      • HOP

        public static final SqlKind HOP
        The HOP group function.
      • HOP_START

        public static final SqlKind HOP_START
        The HOP_START auxiliary function of the HOP group function.
      • HOP_END

        public static final SqlKind HOP_END
        The HOP_END auxiliary function of the HOP group function.
      • SESSION

        public static final SqlKind SESSION
        The SESSION group function.
      • SESSION_START

        public static final SqlKind SESSION_START
        The SESSION_START auxiliary function of the SESSION group function.
      • SESSION_END

        public static final SqlKind SESSION_END
        The SESSION_END auxiliary function of the SESSION group function.
      • COLUMN_DECL

        public static final SqlKind COLUMN_DECL
        Column declaration.
      • ATTRIBUTE_DEF

        public static final SqlKind ATTRIBUTE_DEF
        Attribute definition.
      • CHECK

        public static final SqlKind CHECK
        CHECK constraint.
      • UNIQUE

        public static final SqlKind UNIQUE
        UNIQUE constraint.
      • PRIMARY_KEY

        public static final SqlKind PRIMARY_KEY
        PRIMARY KEY constraint.
      • FOREIGN_KEY

        public static final SqlKind FOREIGN_KEY
        FOREIGN KEY constraint.
      • COMMIT

        public static final SqlKind COMMIT
        COMMIT session control statement.
      • ROLLBACK

        public static final SqlKind ROLLBACK
        ROLLBACK session control statement.
      • ALTER_SESSION

        public static final SqlKind ALTER_SESSION
        ALTER SESSION DDL statement.
      • CREATE_SCHEMA

        public static final SqlKind CREATE_SCHEMA
        CREATE SCHEMA DDL statement.
      • CREATE_FOREIGN_SCHEMA

        public static final SqlKind CREATE_FOREIGN_SCHEMA
        CREATE FOREIGN SCHEMA DDL statement.
      • DROP_SCHEMA

        public static final SqlKind DROP_SCHEMA
        DROP SCHEMA DDL statement.
      • CREATE_TABLE

        public static final SqlKind CREATE_TABLE
        CREATE TABLE DDL statement.
      • ALTER_TABLE

        public static final SqlKind ALTER_TABLE
        ALTER TABLE DDL statement.
      • DROP_TABLE

        public static final SqlKind DROP_TABLE
        DROP TABLE DDL statement.
      • CREATE_VIEW

        public static final SqlKind CREATE_VIEW
        CREATE VIEW DDL statement.
      • ALTER_VIEW

        public static final SqlKind ALTER_VIEW
        ALTER VIEW DDL statement.
      • DROP_VIEW

        public static final SqlKind DROP_VIEW
        DROP VIEW DDL statement.
      • CREATE_MATERIALIZED_VIEW

        public static final SqlKind CREATE_MATERIALIZED_VIEW
        CREATE MATERIALIZED VIEW DDL statement.
      • ALTER_MATERIALIZED_VIEW

        public static final SqlKind ALTER_MATERIALIZED_VIEW
        ALTER MATERIALIZED VIEW DDL statement.
      • DROP_MATERIALIZED_VIEW

        public static final SqlKind DROP_MATERIALIZED_VIEW
        DROP MATERIALIZED VIEW DDL statement.
      • CREATE_SEQUENCE

        public static final SqlKind CREATE_SEQUENCE
        CREATE SEQUENCE DDL statement.
      • ALTER_SEQUENCE

        public static final SqlKind ALTER_SEQUENCE
        ALTER SEQUENCE DDL statement.
      • DROP_SEQUENCE

        public static final SqlKind DROP_SEQUENCE
        DROP SEQUENCE DDL statement.
      • CREATE_INDEX

        public static final SqlKind CREATE_INDEX
        CREATE INDEX DDL statement.
      • ALTER_INDEX

        public static final SqlKind ALTER_INDEX
        ALTER INDEX DDL statement.
      • DROP_INDEX

        public static final SqlKind DROP_INDEX
        DROP INDEX DDL statement.
      • CREATE_TYPE

        public static final SqlKind CREATE_TYPE
        CREATE TYPE DDL statement.
      • DROP_TYPE

        public static final SqlKind DROP_TYPE
        DROP TYPE DDL statement.
      • CREATE_FUNCTION

        public static final SqlKind CREATE_FUNCTION
        CREATE FUNCTION DDL statement.
      • DROP_FUNCTION

        public static final SqlKind DROP_FUNCTION
        DROP FUNCTION DDL statement.
      • OTHER_DDL

        public static final SqlKind OTHER_DDL
        DDL statement not handled above.

        Note to other projects: If you are extending Calcite's SQL parser and have your own object types you no doubt want to define CREATE and DROP commands for them. Use OTHER_DDL in the short term, but we are happy to add new enum values for your object types. Just ask!

    • Constructor Detail

      • SqlKind

        private SqlKind()
      • SqlKind

        private SqlKind​(java.lang.String sql)
    • Method Detail

      • values

        public static SqlKind[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SqlKind c : SqlKind.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SqlKind valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • reverse

        public SqlKind reverse()
        Returns the kind that corresponds to this operator but in the opposite direction. Or returns this, if this kind is not reversible.

        For example, GREATER_THAN.reverse() returns LESS_THAN.

      • negate

        public SqlKind negate()
        Returns the kind that you get if you apply NOT to this kind.

        For example, IS_NOT_NULL.negate() returns IS_NULL.

        For IS_TRUE, IS_FALSE, IS_NOT_TRUE, IS_NOT_FALSE, nullable inputs need to be treated carefully.

        NOT(IS_TRUE(null)) = NOT(false) = true, while IS_FALSE(null) = false, so NOT(IS_TRUE(X)) should be IS_NOT_TRUE(X). On the other hand, IS_TRUE(NOT(null)) = IS_TRUE(null) = false.

        This is why negate() != negateNullSafe() for these operators.

      • negateNullSafe

        public SqlKind negateNullSafe()
        Returns the kind that you get if you negate this kind. To conform to null semantics, null value should not be compared.

        For IS_TRUE, IS_FALSE, IS_NOT_TRUE and IS_NOT_FALSE, nullable inputs need to be treated carefully:

        • NOT(IS_TRUE(null)) = NOT(false) = true
        • IS_TRUE(NOT(null)) = IS_TRUE(null) = false
        • IS_FALSE(null) = false
        • IS_NOT_TRUE(null) = true
      • belongsTo

        public final boolean belongsTo​(java.util.Collection<SqlKind> category)
        Returns whether this SqlKind belongs to a given category.

        A category is a collection of kinds, not necessarily disjoint. For example, QUERY is { SELECT, UNION, INTERSECT, EXCEPT, VALUES, ORDER_BY, EXPLICIT_TABLE }.

        Parameters:
        category - Category
        Returns:
        Whether this kind belongs to the given category
      • concat

        @SafeVarargs
        private static <E extends java.lang.Enum<E>> java.util.EnumSet<E> concat​(java.util.EnumSet<E> set0,
                                                                                 java.util.EnumSet<E>... sets)