Enum SqlKind

java.lang.Object
java.lang.Enum<SqlKind>
org.apache.calcite.sql.SqlKind
All Implemented Interfaces:
Serializable, Comparable<SqlKind>, Constable

public enum SqlKind extends 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 identify 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 Details

    • OTHER

      public static final SqlKind OTHER
      Expression not covered by any other SqlKind value.
      See Also:
    • SELECT

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

      public static final SqlKind HINT
      Sql Hint statement.
    • TABLE_REF

      public static final SqlKind TABLE_REF
      Table reference.
    • 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
      An identifier.
    • LITERAL

      public static final SqlKind LITERAL
      A literal.
    • INTERVAL_QUALIFIER

      public static final SqlKind INTERVAL_QUALIFIER
      Interval qualifier.
    • OTHER_FUNCTION

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

      public static final SqlKind SET_SEMANTICS_TABLE
      Input tables have either row semantics or set semantics.
      • Row semantics means that the result of the table function is decided on a row-by-row basis.
      • Set semantics means that the outcome of the function depends on how the data is partitioned. When the table function is called from a query, the table parameter can optionally be extended with either a PARTITION BY clause or an ORDER BY clause or both.
    • CONVERT

      public static final SqlKind CONVERT
      CONVERT function.
    • TRANSLATE

      public static final SqlKind TRANSLATE
      TRANSLATE 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.
    • GROUP_BY_DISTINCT

      public static final SqlKind GROUP_BY_DISTINCT
      The DISTINCT keyword of the GROUP BY clause.
    • ORDER_BY

      public static final SqlKind ORDER_BY
      ORDER BY clause.
      See Also:
    • WITH

      public static final SqlKind WITH
      WITH clause.
    • WITH_ITEM

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

      public static final SqlKind WITH_ITEM_TABLE_REF
      Represents a recursive CTE as a table ref.
    • ITEM

      public static final SqlKind ITEM
      Item expression.
    • UNION

      public static final SqlKind UNION
      UNION relational operator.
    • EXCEPT

      public static final SqlKind EXCEPT
      EXCEPT relational operator (known as MINUS in some SQL dialects).
    • INTERSECT

      public static final SqlKind INTERSECT
      INTERSECT relational operator.
    • AS

      public static final SqlKind AS
      AS operator.
    • MEASURE

      public static final SqlKind MEASURE
      MEASURE operator.
    • V2M

      public static final SqlKind V2M
      V2M (value-to-measure) internal operator.
    • M2V

      public static final SqlKind M2V
      M2V (measure-to-value) internal operator.
    • M2X

      public static final SqlKind M2X
      M2X (evaluate measure in context) internal operator.
    • AGG_M2M

      public static final SqlKind AGG_M2M
      AGG_M2M (aggregate measure to measure) internal aggregate function.
    • AGG_M2V

      public static final SqlKind AGG_M2V
      AGG_M2V (aggregate measure to value) internal aggregate function.
    • SAME_PARTITION

      public static final SqlKind SAME_PARTITION
      SAME_PARTITION pseudo-function.
    • 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.
    • WITHIN_DISTINCT

      public static final SqlKind WITHIN_DISTINCT
      WITHIN DISTINCT operator.
    • WINDOW

      public static final SqlKind WINDOW
      Window specification.
    • MERGE

      public static final SqlKind MERGE
      MERGE statement.
    • TABLESAMPLE

      public static final SqlKind TABLESAMPLE
      TABLESAMPLE relational operator.
    • PIVOT

      public static final SqlKind PIVOT
      PIVOT clause.
    • UNPIVOT

      public static final SqlKind UNPIVOT
      UNPIVOT clause.
    • 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
      Arithmetic multiplication operator, "*".
    • DIVIDE

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

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

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

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

      public static final SqlKind PATTERN_ALTER
      Alternation operator in a pattern expression within a MATCH_RECOGNIZE clause.
    • PATTERN_CONCAT

      public static final SqlKind PATTERN_CONCAT
      Concatenation operator in a pattern expression within a MATCH_RECOGNIZE clause.
    • IN

      public static final SqlKind IN
      IN operator.
    • NOT_IN

      public static final SqlKind NOT_IN
      NOT IN operator.

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

    • DRUID_IN

      public static final SqlKind DRUID_IN
      Variant of IN for the Druid adapter.
    • DRUID_NOT_IN

      public static final SqlKind DRUID_NOT_IN
      Variant of NOT_IN for the Druid adapter.
    • LESS_THAN

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

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

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

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

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

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

      public static final SqlKind IS_DISTINCT_FROM
      IS DISTINCT FROM operator.
    • IS_NOT_DISTINCT_FROM

      public static final SqlKind IS_NOT_DISTINCT_FROM
      IS NOT DISTINCT FROM operator.
    • OR

      public static final SqlKind OR
      Logical "OR" operator.
    • AND

      public static final SqlKind AND
      Logical "AND" operator.
    • DOT

      public static final SqlKind DOT
      Dot.
    • OVERLAPS

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

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

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

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

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

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

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

      public static final SqlKind LIKE
      LIKE operator.
    • RLIKE

      public static final SqlKind RLIKE
      RLIKE operator.
    • SIMILAR

      public static final SqlKind SIMILAR
      SIMILAR operator.
    • POSIX_REGEX_CASE_SENSITIVE

      public static final SqlKind POSIX_REGEX_CASE_SENSITIVE
      ~ operator (for POSIX-style regular expressions).
    • POSIX_REGEX_CASE_INSENSITIVE

      public static final SqlKind POSIX_REGEX_CASE_INSENSITIVE
      ~* operator (for case-insensitive POSIX-style regular expressions).
    • BETWEEN

      public static final SqlKind BETWEEN
      BETWEEN operator.
    • DRUID_BETWEEN

      public static final SqlKind DRUID_BETWEEN
      Variant of BETWEEN for the Druid adapter.
    • CASE

      public static final SqlKind CASE
      CASE expression.
    • LAMBDA

      public static final SqlKind LAMBDA
      LAMBDA expression.
    • INTERVAL

      public static final SqlKind INTERVAL
      INTERVAL expression.
    • SEPARATOR

      public static final SqlKind SEPARATOR
      SEPARATOR expression.
    • NULLIF

      public static final SqlKind NULLIF
      NULLIF operator.
    • COALESCE

      public static final SqlKind COALESCE
      COALESCE operator.
    • DECODE

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

      public static final SqlKind NVL
      NVL function (Oracle, Spark).
    • NVL2

      public static final SqlKind NVL2
      NVL2 function (Oracle, Spark).
    • GREATEST

      public static final SqlKind GREATEST
      GREATEST function (Oracle, Spark).
    • GREATEST_PG

      public static final SqlKind GREATEST_PG
      GREATEST function (PostgreSQL).
    • CONCAT2

      public static final SqlKind CONCAT2
      The two-argument CONCAT function (Oracle).
    • CONCAT_WITH_NULL

      public static final SqlKind CONCAT_WITH_NULL
      The CONCAT function (Postgresql and MSSQL) that ignores NULL.
    • CONCAT_WS_MSSQL

      public static final SqlKind CONCAT_WS_MSSQL
      The CONCAT_WS function (MSSQL).
    • CONCAT_WS_POSTGRESQL

      public static final SqlKind CONCAT_WS_POSTGRESQL
      The CONCAT_WS function (Postgresql).
    • CONCAT_WS_SPARK

      public static final SqlKind CONCAT_WS_SPARK
      The CONCAT_WS function (Spark).
    • IF

      public static final SqlKind IF
      The "IF" function (BigQuery, Hive, Spark).
    • LEAST

      public static final SqlKind LEAST
      LEAST function (Oracle).
    • LEAST_PG

      public static final SqlKind LEAST_PG
      LEAST function (PostgreSQL).
    • LOG

      public static final SqlKind LOG
      LOG function. (Mysql, Spark).
    • DATE_ADD

      public static final SqlKind DATE_ADD
      DATE_ADD function (BigQuery Semantics).
    • ADD_MONTHS

      public static final SqlKind ADD_MONTHS
      ADD_MONTHS function (Oracle, Spark).
    • DATE_TRUNC

      public static final SqlKind DATE_TRUNC
      DATE_TRUNC function (BigQuery).
    • DATE_SUB

      public static final SqlKind DATE_SUB
      DATE_SUB function (BigQuery).
    • TIME_ADD

      public static final SqlKind TIME_ADD
      TIME_ADD function (BigQuery).
    • TIME_SUB

      public static final SqlKind TIME_SUB
      TIME_SUB function (BigQuery).
    • TIMESTAMP_ADD

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

      public static final SqlKind TIMESTAMP_DIFF
      TIMESTAMP_DIFF function (ODBC, SQL Server, MySQL).
    • TIMESTAMP_SUB

      public static final SqlKind TIMESTAMP_SUB
      TIMESTAMP_SUB function (BigQuery).
    • NOT

      public static final SqlKind NOT
      Logical NOT operator.
    • PLUS_PREFIX

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

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

      public static final SqlKind EXISTS
      EXISTS operator.
    • SOME

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

      public static final SqlKind ALL
      ALL quantification operator.
    • VALUES

      public static final SqlKind VALUES
      VALUES relational 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
      Procedure call.
    • NEW_SPECIFICATION

      public static final SqlKind NEW_SPECIFICATION
      New specification.
    • FINAL

      public static final SqlKind FINAL
      FINAL operator in MATCH_RECOGNIZE.
    • RUNNING

      public static final SqlKind RUNNING
      FINAL operator in MATCH_RECOGNIZE.
    • PREV

      public static final SqlKind PREV
      PREV operator in MATCH_RECOGNIZE.
    • NEXT

      public static final SqlKind NEXT
      NEXT operator in MATCH_RECOGNIZE.
    • FIRST

      public static final SqlKind FIRST
      FIRST operator in MATCH_RECOGNIZE.
    • LAST

      public static final SqlKind LAST
      LAST operator in MATCH_RECOGNIZE.
    • CLASSIFIER

      public static final SqlKind CLASSIFIER
      CLASSIFIER operator in MATCH_RECOGNIZE.
    • MATCH_NUMBER

      public static final SqlKind MATCH_NUMBER
      MATCH_NUMBER operator in MATCH_RECOGNIZE.
    • SKIP_TO_FIRST

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

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

      public static final SqlKind DESCENDING
      DESC operator 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
      IS TRUE operator.
    • IS_FALSE

      public static final SqlKind IS_FALSE
      IS FALSE operator.
    • IS_NOT_TRUE

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

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

      public static final SqlKind IS_UNKNOWN
      IS UNKNOWN operator.
    • IS_NULL

      public static final SqlKind IS_NULL
      IS NULL operator.
    • IS_NOT_NULL

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

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

      public static final SqlKind FOLLOWING
      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.)

    • LAMBDA_REF

      public static final SqlKind LAMBDA_REF
      Reference to lambda expression parameter.

      (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, and also the PostgreSQL-style infix cast operator "::".
    • SAFE_CAST

      public static final SqlKind SAFE_CAST
      The SAFE_CAST function, which is similar to CAST but returns NULL rather than throwing an error if the conversion fails.
    • 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
      FLOOR function.
    • CEIL

      public static final SqlKind CEIL
      CEIL function.
    • TRIM

      public static final SqlKind TRIM
      TRIM function.
    • LTRIM

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

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

      public static final SqlKind EXTRACT
      EXTRACT function.
    • ARRAY_APPEND

      public static final SqlKind ARRAY_APPEND
      ARRAY_APPEND function (Spark semantics).
    • ARRAY_COMPACT

      public static final SqlKind ARRAY_COMPACT
      ARRAY_COMPACT function (Spark semantics).
    • ARRAY_CONCAT

      public static final SqlKind ARRAY_CONCAT
      ARRAY_CONCAT function (BigQuery semantics).
    • ARRAY_CONTAINS

      public static final SqlKind ARRAY_CONTAINS
      ARRAY_CONTAINS function (Spark semantics).
    • ARRAY_DISTINCT

      public static final SqlKind ARRAY_DISTINCT
      ARRAY_DISTINCT function (Spark semantics).
    • ARRAY_EXCEPT

      public static final SqlKind ARRAY_EXCEPT
      ARRAY_EXCEPT function (Spark semantics).
    • ARRAY_INSERT

      public static final SqlKind ARRAY_INSERT
      ARRAY_INSERT function (Spark semantics).
    • ARRAY_INTERSECT

      public static final SqlKind ARRAY_INTERSECT
      ARRAY_INTERSECT function (Spark semantics).
    • ARRAY_JOIN

      public static final SqlKind ARRAY_JOIN
      ARRAY_JOIN function (Spark semantics).
    • ARRAY_LENGTH

      public static final SqlKind ARRAY_LENGTH
      ARRAY_LENGTH function (Spark semantics).
    • ARRAY_MAX

      public static final SqlKind ARRAY_MAX
      ARRAY_MAX function (Spark semantics).
    • ARRAY_MIN

      public static final SqlKind ARRAY_MIN
      ARRAY_MIN function (Spark semantics).
    • ARRAY_POSITION

      public static final SqlKind ARRAY_POSITION
      ARRAY_POSITION function (Spark semantics).
    • ARRAY_PREPEND

      public static final SqlKind ARRAY_PREPEND
      ARRAY_PREPEND function (Spark semantics).
    • ARRAY_REMOVE

      public static final SqlKind ARRAY_REMOVE
      ARRAY_REMOVE function (Spark semantics).
    • ARRAY_REPEAT

      public static final SqlKind ARRAY_REPEAT
      ARRAY_REPEAT function (Spark semantics).
    • ARRAY_REVERSE

      public static final SqlKind ARRAY_REVERSE
      ARRAY_REVERSE function (BigQuery semantics).
    • ARRAY_SIZE

      public static final SqlKind ARRAY_SIZE
      ARRAY_SIZE function (Spark semantics).
    • ARRAY_TO_STRING

      public static final SqlKind ARRAY_TO_STRING
      ARRAY_TO_STRING function (BigQuery semantics).
    • ARRAY_UNION

      public static final SqlKind ARRAY_UNION
      ARRAY_UNION function (Spark semantics).
    • ARRAYS_OVERLAP

      public static final SqlKind ARRAYS_OVERLAP
      ARRAYS_OVERLAP function (Spark semantics).
    • ARRAYS_ZIP

      public static final SqlKind ARRAYS_ZIP
      ARRAYS_ZIP function (Spark semantics).
    • SORT_ARRAY

      public static final SqlKind SORT_ARRAY
      SORT_ARRAY function (Spark semantics).
    • MAP_CONCAT

      public static final SqlKind MAP_CONCAT
      MAP_CONCAT function (Spark semantics).
    • MAP_ENTRIES

      public static final SqlKind MAP_ENTRIES
      MAP_ENTRIES function (Spark semantics).
    • MAP_KEYS

      public static final SqlKind MAP_KEYS
      MAP_KEYS function (Spark semantics).
    • MAP_VALUES

      public static final SqlKind MAP_VALUES
      MAP_VALUES function (Spark semantics).
    • MAP_CONTAINS_KEY

      public static final SqlKind MAP_CONTAINS_KEY
      MAP_CONTAINS_KEY function (Spark semantics).
    • MAP_FROM_ARRAYS

      public static final SqlKind MAP_FROM_ARRAYS
      MAP_FROM_ARRAYS function (Spark semantics).
    • MAP_FROM_ENTRIES

      public static final SqlKind MAP_FROM_ENTRIES
      MAP_FROM_ENTRIES function (Spark semantics).
    • STR_TO_MAP

      public static final SqlKind STR_TO_MAP
      STR_TO_MAP function (Spark semantics).
    • SUBSTRING_INDEX

      public static final SqlKind SUBSTRING_INDEX
      SUBSTRING_INDEX function (Spark semantics).
    • REVERSE

      public static final SqlKind REVERSE
      REVERSE function (SQL Server, MySQL).
    • REVERSE_SPARK

      public static final SqlKind REVERSE_SPARK
      REVERSE function (Spark semantics).
    • SOUNDEX_SPARK

      public static final SqlKind SOUNDEX_SPARK
      SOUNDEX function (Spark semantics).
    • SUBSTR_BIG_QUERY

      public static final SqlKind SUBSTR_BIG_QUERY
      SUBSTR function (BigQuery semantics).
    • SUBSTR_MYSQL

      public static final SqlKind SUBSTR_MYSQL
      SUBSTR function (MySQL semantics).
    • SUBSTR_ORACLE

      public static final SqlKind SUBSTR_ORACLE
      SUBSTR function (Oracle semantics).
    • SUBSTR_POSTGRESQL

      public static final SqlKind SUBSTR_POSTGRESQL
      SUBSTR function (PostgreSQL semantics).
    • CHAR_LENGTH

      public static final SqlKind CHAR_LENGTH
      CHAR_LENGTH function.
    • ENDS_WITH

      public static final SqlKind ENDS_WITH
      ENDS_WITH function.
    • STARTS_WITH

      public static final SqlKind STARTS_WITH
      STARTS_WITH function.
    • 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
      MULTISET value constructor.
    • MULTISET_QUERY_CONSTRUCTOR

      public static final SqlKind MULTISET_QUERY_CONSTRUCTOR
      MULTISET query constructor.
    • JSON_VALUE_EXPRESSION

      public static final SqlKind JSON_VALUE_EXPRESSION
      JSON value expression.
    • JSON_ARRAYAGG

      public static final SqlKind JSON_ARRAYAGG
      JSON_ARRAYAGG aggregate function.
    • JSON_OBJECTAGG

      public static final SqlKind JSON_OBJECTAGG
      JSON_OBJECTAGG aggregate function.
    • JSON_TYPE

      public static final SqlKind JSON_TYPE
      JSON type function.
    • UNNEST

      public static final SqlKind UNNEST
      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)).
    • CONTAINS_SUBSTR

      public static final SqlKind CONTAINS_SUBSTR
      CONTAINS_SUBSTR function (BigQuery semantics).
    • LITERAL_AGG

      public static final SqlKind LITERAL_AGG
      The LITERAL_AGG aggregate function that always returns the same literal (even if the group is empty).

      Useful during optimization because it allows you to, say, generate a non-null value (to detect outer joins) in an Aggregate without an extra Project.

    • 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.
    • STRING_AGG

      public static final SqlKind STRING_AGG
      The STRING_AGG aggregate function.
    • COUNTIF

      public static final SqlKind COUNTIF
      The COUNTIF aggregate function.
    • ARRAY_AGG

      public static final SqlKind ARRAY_AGG
      The ARRAY_AGG aggregate function.
    • ARRAY_CONCAT_AGG

      public static final SqlKind ARRAY_CONCAT_AGG
      The ARRAY_CONCAT_AGG aggregate function.
    • GROUP_CONCAT

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

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

      public static final SqlKind MODE
      The MODE aggregate function.
    • ARG_MAX

      public static final SqlKind ARG_MAX
      The ARG_MAX aggregate function.
    • ARG_MIN

      public static final SqlKind ARG_MIN
      The ARG_MIN aggregate function.
    • PERCENTILE_CONT

      public static final SqlKind PERCENTILE_CONT
      The PERCENTILE_CONT aggregate function.
    • PERCENTILE_DISC

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

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

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

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

      public static final SqlKind AGGREGATE_FN
      The AGGREGATE aggregate function.
    • BITAND

      public static final SqlKind BITAND
      The BITAND scalar function.
    • BITOR

      public static final SqlKind BITOR
      The BITOR scalar function.
    • BITXOR

      public static final SqlKind BITXOR
      The BITXOR scalar function.
    • BITNOT

      public static final SqlKind BITNOT
      The BITNOT scalar 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.
    • BIT_XOR

      public static final SqlKind BIT_XOR
      The BIT_XOR 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.
    • DESCRIPTOR

      public static final SqlKind DESCRIPTOR
      The DESCRIPTOR(column_name, ...).
    • 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.
    • ST_DWITHIN

      public static final SqlKind ST_DWITHIN
      The ST_DWithin geo-spatial function.
    • ST_POINT

      public static final SqlKind ST_POINT
      The ST_Point function.
    • ST_POINT3

      public static final SqlKind ST_POINT3
      The ST_Point function that makes a 3D point.
    • ST_MAKE_LINE

      public static final SqlKind ST_MAKE_LINE
      The ST_MakeLine function that makes a line.
    • ST_CONTAINS

      public static final SqlKind ST_CONTAINS
      The ST_Contains function that tests whether one geometry contains another.
    • HILBERT

      public static final SqlKind HILBERT
      The Hilbert function that converts (x, y) to a position on a Hilbert space-filling curve.
    • 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.
    • CREATE_TABLE_LIKE

      public static final SqlKind CREATE_TABLE_LIKE
      CREATE TABLE LIKE 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.
    • TRUNCATE_TABLE

      public static final SqlKind TRUNCATE_TABLE
      TRUNCATE 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!

  • Field Details

  • Method Details

    • values

      public static SqlKind[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static SqlKind valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      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(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
    • getFunctionKind

      public SqlKind getFunctionKind()
      If this kind represents a non-standard function, return OTHER_FUNCTION, otherwise return this. Do not add standard functions here.