Class SqlStdOperatorTable

java.lang.Object
org.apache.calcite.sql.util.ReflectiveSqlOperatorTable
org.apache.calcite.sql.fun.SqlStdOperatorTable
All Implemented Interfaces:
SqlOperatorTable

public class SqlStdOperatorTable extends ReflectiveSqlOperatorTable
Implementation of SqlOperatorTable containing the standard operators and functions.
  • Field Details

    • UNION

      public static final SqlSetOperator UNION
    • UNION_ALL

      public static final SqlSetOperator UNION_ALL
    • EXCEPT

      public static final SqlSetOperator EXCEPT
    • EXCEPT_ALL

      public static final SqlSetOperator EXCEPT_ALL
    • INTERSECT

      public static final SqlSetOperator INTERSECT
    • INTERSECT_ALL

      public static final SqlSetOperator INTERSECT_ALL
    • MULTISET_UNION_DISTINCT

      public static final SqlMultisetSetOperator MULTISET_UNION_DISTINCT
      The MULTISET UNION DISTINCT operator.
    • MULTISET_UNION

      public static final SqlMultisetSetOperator MULTISET_UNION
      The MULTISET UNION [ALL] operator.
    • MULTISET_EXCEPT_DISTINCT

      public static final SqlMultisetSetOperator MULTISET_EXCEPT_DISTINCT
      The MULTISET EXCEPT DISTINCT operator.
    • MULTISET_EXCEPT

      public static final SqlMultisetSetOperator MULTISET_EXCEPT
      The MULTISET EXCEPT [ALL] operator.
    • MULTISET_INTERSECT_DISTINCT

      public static final SqlMultisetSetOperator MULTISET_INTERSECT_DISTINCT
      The MULTISET INTERSECT DISTINCT operator.
    • MULTISET_INTERSECT

      public static final SqlMultisetSetOperator MULTISET_INTERSECT
      The MULTISET INTERSECT [ALL] operator.
    • AND

      public static final SqlBinaryOperator AND
      Logical AND operator.
    • AS

      public static final SqlAsOperator AS
      AS operator associates an expression in the SELECT clause with an alias.
    • ARGUMENT_ASSIGNMENT

      public static final SqlSpecialOperator ARGUMENT_ASSIGNMENT
      ARGUMENT_ASSIGNMENT operator (=<) assigns an argument to a function call to a particular named parameter.
    • DEFAULT

      public static final SqlSpecialOperator DEFAULT
      DEFAULT operator indicates that an argument to a function call is to take its default value..
    • FILTER

      public static final SqlFilterOperator FILTER
      FILTER operator filters which rows are included in an aggregate function.
    • WITHIN_GROUP

      public static final SqlWithinGroupOperator WITHIN_GROUP
      WITHIN_GROUP operator performs aggregations on ordered data input.
    • WITHIN_DISTINCT

      public static final SqlWithinDistinctOperator WITHIN_DISTINCT
      WITHIN_DISTINCT operator performs aggregations on distinct data input.
    • CUBE

      public static final SqlInternalOperator CUBE
      CUBE operator, occurs within GROUP BY clause or nested within a GROUPING SETS.
    • ROLLUP

      public static final SqlInternalOperator ROLLUP
      ROLLUP operator, occurs within GROUP BY clause or nested within a GROUPING SETS.
    • GROUPING_SETS

      public static final SqlInternalOperator GROUPING_SETS
      GROUPING SETS operator, occurs within GROUP BY clause or nested within a GROUPING SETS.
    • GROUPING

      public static final SqlAggFunction GROUPING
      GROUPING(c1 [, c2, ...]) function.

      Occurs in similar places to an aggregate function (SELECT, HAVING clause, etc. of an aggregate query), but not technically an aggregate function.

    • GROUP_ID

      public static final SqlAggFunction GROUP_ID
      GROUP_ID() function. (Oracle-specific.)
    • GROUPING_ID

      public static final SqlAggFunction GROUPING_ID
      GROUPING_ID function is a synonym for GROUPING.

      Some history. The GROUPING function is in the SQL standard, and originally supported only one argument. GROUPING_ID is not standard (though supported in Oracle and SQL Server) and supports one or more arguments.

      The SQL standard has changed to allow GROUPING to have multiple arguments. It is now equivalent to GROUPING_ID, so we made GROUPING_ID a synonym for GROUPING.

    • EXTEND

      public static final SqlInternalOperator EXTEND
      EXTEND operator.
    • CONCAT

      public static final SqlBinaryOperator CONCAT
      String and array-to-array concatenation operator, '||'.
      See Also:
    • DIVIDE

      public static final SqlBinaryOperator DIVIDE
      Arithmetic division operator, '/'.
    • PERCENT_REMAINDER

      public static final SqlBinaryOperator PERCENT_REMAINDER
      Arithmetic remainder operator, '%', an alternative to MOD allowed if under certain conformance levels.
      See Also:
    • RAND_INTEGER

      public static final SqlRandIntegerFunction RAND_INTEGER
      The RAND_INTEGER([seed, ] bound) function, which yields a random integer, optionally with seed.
    • RAND

      public static final SqlRandFunction RAND
      The RAND([seed]) function, which yields a random double, optionally with seed.
    • DIVIDE_INTEGER

      public static final SqlBinaryOperator DIVIDE_INTEGER
      Internal integer arithmetic division operator, '/INT'. This is only used to adjust scale for numerics. We distinguish it from user-requested division since some personalities want a floating-point computation, whereas for the internal scaling use of division, we always want integer division.
    • DOT

      public static final SqlOperator DOT
      Dot operator, '.', used for referencing fields of records.
    • EQUALS

      public static final SqlBinaryOperator EQUALS
      Logical equals operator, '='.
    • GREATER_THAN

      public static final SqlBinaryOperator GREATER_THAN
      Logical greater-than operator, '>'.
    • IS_DISTINCT_FROM

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

      public static final SqlBinaryOperator IS_NOT_DISTINCT_FROM
      IS NOT DISTINCT FROM operator. Is equivalent to NOT(x IS DISTINCT FROM y)
    • IS_DIFFERENT_FROM

      public static final SqlBinaryOperator IS_DIFFERENT_FROM
      The internal $IS_DIFFERENT_FROM operator is the same as the user-level IS_DISTINCT_FROM in all respects except that the test for equality on character datatypes treats trailing spaces as significant.
    • GREATER_THAN_OR_EQUAL

      public static final SqlBinaryOperator GREATER_THAN_OR_EQUAL
      Logical greater-than-or-equal operator, '>='.
    • IN

      public static final SqlBinaryOperator IN
      IN operator tests for a value's membership in a sub-query or a list of values.
    • NOT_IN

      public static final SqlBinaryOperator NOT_IN
      NOT IN operator tests for a value's membership in a sub-query or a list of values.
    • SOME_LT

      public static final SqlQuantifyOperator SOME_LT
      The < SOME operator (synonymous with < ANY).
    • SOME_LE

      public static final SqlQuantifyOperator SOME_LE
    • SOME_GT

      public static final SqlQuantifyOperator SOME_GT
    • SOME_GE

      public static final SqlQuantifyOperator SOME_GE
    • SOME_EQ

      public static final SqlQuantifyOperator SOME_EQ
    • SOME_NE

      public static final SqlQuantifyOperator SOME_NE
    • ALL_LT

      public static final SqlQuantifyOperator ALL_LT
      The < ALL operator.
    • ALL_LE

      public static final SqlQuantifyOperator ALL_LE
    • ALL_GT

      public static final SqlQuantifyOperator ALL_GT
    • ALL_GE

      public static final SqlQuantifyOperator ALL_GE
    • ALL_EQ

      public static final SqlQuantifyOperator ALL_EQ
    • ALL_NE

      public static final SqlQuantifyOperator ALL_NE
    • QUANTIFY_OPERATORS

      public static final List<SqlQuantifyOperator> QUANTIFY_OPERATORS
    • LESS_THAN

      public static final SqlBinaryOperator LESS_THAN
      Logical less-than operator, '<'.
    • LESS_THAN_OR_EQUAL

      public static final SqlBinaryOperator LESS_THAN_OR_EQUAL
      Logical less-than-or-equal operator, '<='.
    • MINUS

      public static final SqlBinaryOperator MINUS
      Infix arithmetic minus operator, '-'.

      Its precedence is less than the prefix + and - operators.

    • MULTIPLY

      public static final SqlBinaryOperator MULTIPLY
      Arithmetic multiplication operator, '*'.
    • NOT_EQUALS

      public static final SqlBinaryOperator NOT_EQUALS
      Logical not-equals operator, '<>'.
    • OR

      public static final SqlBinaryOperator OR
      Logical OR operator.
    • PLUS

      public static final SqlBinaryOperator PLUS
      Infix arithmetic plus operator, '+'.
    • DATETIME_PLUS

      public static final SqlSpecialOperator DATETIME_PLUS
      Infix datetime plus operator, 'DATETIME + INTERVAL'.
    • INTERVAL

      public static final SqlSpecialOperator INTERVAL
      Interval expression, 'INTERVAL n timeUnit'.
    • MEMBER_OF

      public static final SqlBinaryOperator MEMBER_OF
      Multiset MEMBER OF, which returns whether a element belongs to a multiset.

      For example, the following returns false:

      'green' MEMBER OF MULTISET ['red','almost green','blue']
    • SUBMULTISET_OF

      public static final SqlBinaryOperator SUBMULTISET_OF
      Submultiset. Checks to see if an multiset is a sub-set of another multiset.

      For example, the following returns false:

      MULTISET ['green'] SUBMULTISET OF MULTISET['red', 'almost green', 'blue']

      The following returns true, in part because multisets are order-independent:

      MULTISET ['blue', 'red'] SUBMULTISET OF MULTISET ['red', 'almost green', 'blue']
    • NOT_SUBMULTISET_OF

      public static final SqlBinaryOperator NOT_SUBMULTISET_OF
    • DESC

      public static final SqlPostfixOperator DESC
    • NULLS_FIRST

      public static final SqlPostfixOperator NULLS_FIRST
    • NULLS_LAST

      public static final SqlPostfixOperator NULLS_LAST
    • IS_NOT_NULL

      public static final SqlPostfixOperator IS_NOT_NULL
    • IS_NULL

      public static final SqlPostfixOperator IS_NULL
    • IS_NOT_TRUE

      public static final SqlPostfixOperator IS_NOT_TRUE
    • IS_TRUE

      public static final SqlPostfixOperator IS_TRUE
    • IS_NOT_FALSE

      public static final SqlPostfixOperator IS_NOT_FALSE
    • IS_FALSE

      public static final SqlPostfixOperator IS_FALSE
    • IS_NOT_UNKNOWN

      public static final SqlPostfixOperator IS_NOT_UNKNOWN
    • IS_UNKNOWN

      public static final SqlPostfixOperator IS_UNKNOWN
    • IS_A_SET

      public static final SqlPostfixOperator IS_A_SET
    • IS_NOT_A_SET

      public static final SqlPostfixOperator IS_NOT_A_SET
    • IS_EMPTY

      public static final SqlPostfixOperator IS_EMPTY
    • IS_NOT_EMPTY

      public static final SqlPostfixOperator IS_NOT_EMPTY
    • IS_JSON_VALUE

      public static final SqlPostfixOperator IS_JSON_VALUE
    • IS_NOT_JSON_VALUE

      public static final SqlPostfixOperator IS_NOT_JSON_VALUE
    • IS_JSON_OBJECT

      public static final SqlPostfixOperator IS_JSON_OBJECT
    • IS_NOT_JSON_OBJECT

      public static final SqlPostfixOperator IS_NOT_JSON_OBJECT
    • IS_JSON_ARRAY

      public static final SqlPostfixOperator IS_JSON_ARRAY
    • IS_NOT_JSON_ARRAY

      public static final SqlPostfixOperator IS_NOT_JSON_ARRAY
    • IS_JSON_SCALAR

      public static final SqlPostfixOperator IS_JSON_SCALAR
    • IS_NOT_JSON_SCALAR

      public static final SqlPostfixOperator IS_NOT_JSON_SCALAR
    • JSON_VALUE_EXPRESSION

      public static final SqlPostfixOperator JSON_VALUE_EXPRESSION
    • JSON_TYPE_OPERATOR

      public static final org.apache.calcite.sql.fun.SqlJsonTypeOperator JSON_TYPE_OPERATOR
    • EXISTS

      public static final SqlPrefixOperator EXISTS
    • UNIQUE

      public static final SqlPrefixOperator UNIQUE
    • NOT

      public static final SqlPrefixOperator NOT
    • UNARY_MINUS

      public static final SqlPrefixOperator UNARY_MINUS
      Prefix arithmetic minus operator, '-'.

      Its precedence is greater than the infix '+' and '-' operators.

    • UNARY_PLUS

      public static final SqlPrefixOperator UNARY_PLUS
      Prefix arithmetic plus operator, '+'.

      Its precedence is greater than the infix '+' and '-' operators.

    • EXPLICIT_TABLE

      public static final SqlPrefixOperator EXPLICIT_TABLE
      Keyword which allows an identifier to be explicitly flagged as a table. For example, select * from (TABLE t) or TABLE t. See also COLLECTION_TABLE.
    • FINAL

      public static final SqlPrefixOperator FINAL
      FINAL function to be used within MATCH_RECOGNIZE.
    • RUNNING

      public static final SqlPrefixOperator RUNNING
      RUNNING function to be used within MATCH_RECOGNIZE.
    • SUM

      public static final SqlAggFunction SUM
      SUM aggregate function.
    • COUNT

      public static final SqlAggFunction COUNT
      COUNT aggregate function.
    • MODE

      public static final SqlAggFunction MODE
      MODE aggregate function.
    • APPROX_COUNT_DISTINCT

      public static final SqlAggFunction APPROX_COUNT_DISTINCT
      APPROX_COUNT_DISTINCT aggregate function.
    • ARG_MAX

      public static final SqlBasicAggFunction ARG_MAX
      ARG_MAX aggregate function.
    • ARG_MIN

      public static final SqlBasicAggFunction ARG_MIN
      ARG_MIN aggregate function.
    • MIN

      public static final SqlAggFunction MIN
      MIN aggregate function.
    • MAX

      public static final SqlAggFunction MAX
      MAX aggregate function.
    • EVERY

      public static final SqlAggFunction EVERY
      EVERY aggregate function.
    • SOME

      public static final SqlAggFunction SOME
      SOME aggregate function.
    • LAST_VALUE

      public static final SqlAggFunction LAST_VALUE
      LAST_VALUE aggregate function.
    • ANY_VALUE

      public static final SqlAggFunction ANY_VALUE
      ANY_VALUE aggregate function.
    • FIRST_VALUE

      public static final SqlAggFunction FIRST_VALUE
      FIRST_VALUE aggregate function.
    • NTH_VALUE

      public static final SqlAggFunction NTH_VALUE
      NTH_VALUE aggregate function.
    • LEAD

      public static final SqlAggFunction LEAD
      LEAD aggregate function.
    • LAG

      public static final SqlAggFunction LAG
      LAG aggregate function.
    • NTILE

      public static final SqlAggFunction NTILE
      NTILE aggregate function.
    • SINGLE_VALUE

      public static final SqlAggFunction SINGLE_VALUE
      SINGLE_VALUE aggregate function.
    • AVG

      public static final SqlAggFunction AVG
      AVG aggregate function.
    • STDDEV_POP

      public static final SqlAggFunction STDDEV_POP
      STDDEV_POP aggregate function.
    • REGR_COUNT

      public static final SqlAggFunction REGR_COUNT
      REGR_COUNT aggregate function.
    • REGR_SXX

      public static final SqlAggFunction REGR_SXX
      REGR_SXX aggregate function.
    • REGR_SYY

      public static final SqlAggFunction REGR_SYY
      REGR_SYY aggregate function.
    • COVAR_POP

      public static final SqlAggFunction COVAR_POP
      COVAR_POP aggregate function.
    • COVAR_SAMP

      public static final SqlAggFunction COVAR_SAMP
      COVAR_SAMP aggregate function.
    • STDDEV_SAMP

      public static final SqlAggFunction STDDEV_SAMP
      STDDEV_SAMP aggregate function.
    • STDDEV

      public static final SqlAggFunction STDDEV
      STDDEV aggregate function.
    • VAR_POP

      public static final SqlAggFunction VAR_POP
      VAR_POP aggregate function.
    • VAR_SAMP

      public static final SqlAggFunction VAR_SAMP
      VAR_SAMP aggregate function.
    • VARIANCE

      public static final SqlAggFunction VARIANCE
      VARIANCE aggregate function.
    • BIT_AND

      public static final SqlAggFunction BIT_AND
      BIT_AND aggregate function.
    • BIT_OR

      public static final SqlAggFunction BIT_OR
      BIT_OR aggregate function.
    • BIT_XOR

      public static final SqlAggFunction BIT_XOR
      BIT_XOR aggregate function.
    • HISTOGRAM_AGG

      public static final SqlAggFunction HISTOGRAM_AGG
      HISTOGRAM aggregate function support. Used by window aggregate versions of MIN/MAX
    • HISTOGRAM_MIN

      public static final SqlFunction HISTOGRAM_MIN
      HISTOGRAM_MIN window aggregate function.
    • HISTOGRAM_MAX

      public static final SqlFunction HISTOGRAM_MAX
      HISTOGRAM_MAX window aggregate function.
    • HISTOGRAM_FIRST_VALUE

      public static final SqlFunction HISTOGRAM_FIRST_VALUE
      HISTOGRAM_FIRST_VALUE window aggregate function.
    • HISTOGRAM_LAST_VALUE

      public static final SqlFunction HISTOGRAM_LAST_VALUE
      HISTOGRAM_LAST_VALUE window aggregate function.
    • SUM0

      public static final SqlAggFunction SUM0
      SUM0 aggregate function.
    • CUME_DIST

      public static final SqlRankFunction CUME_DIST
      CUME_DIST window function.
    • DENSE_RANK

      public static final SqlRankFunction DENSE_RANK
      DENSE_RANK window function.
    • PERCENT_RANK

      public static final SqlRankFunction PERCENT_RANK
      PERCENT_RANK window function.
    • RANK

      public static final SqlRankFunction RANK
      RANK window function.
    • ROW_NUMBER

      public static final SqlRankFunction ROW_NUMBER
      ROW_NUMBER window function.
    • ROW

      public static final SqlRowOperator ROW
    • IGNORE_NULLS

      public static final SqlNullTreatmentOperator IGNORE_NULLS
      IGNORE NULLS operator.
    • RESPECT_NULLS

      public static final SqlNullTreatmentOperator RESPECT_NULLS
      RESPECT NULLS operator.
    • MINUS_DATE

      public static final SqlDatetimeSubtractionOperator MINUS_DATE
      A special operator for the subtraction of two DATETIMEs. The format of DATETIME subtraction is:
      "(" <datetime> "-" <datetime> ")" <interval qualifier>

      This operator is special since it needs to hold the additional interval qualifier specification.

    • MULTISET_VALUE

      public static final SqlMultisetValueConstructor MULTISET_VALUE
      The MULTISET Value Constructor. e.g. "MULTISET[1,2,3]".
    • MULTISET_QUERY

      public static final SqlMultisetQueryConstructor MULTISET_QUERY
      The MULTISET Query Constructor. e.g. "SELECT dname, MULTISET(SELECT FROM emp WHERE deptno = dept.deptno) FROM dept".
    • ARRAY_QUERY

      public static final SqlMultisetQueryConstructor ARRAY_QUERY
      The ARRAY Query Constructor. e.g. "SELECT dname, ARRAY(SELECT FROM emp WHERE deptno = dept.deptno) FROM dept".
    • MAP_QUERY

      public static final SqlMultisetQueryConstructor MAP_QUERY
      The MAP Query Constructor. e.g. "MAP(SELECT empno, deptno FROM emp)".
    • CURSOR

      public static final SqlCursorConstructor CURSOR
      The CURSOR constructor. e.g. "SELECT * FROM TABLE(DEDUP(CURSOR(SELECT * FROM EMPS), 'name'))".
    • COLUMN_LIST

      public static final SqlColumnListConstructor COLUMN_LIST
      The COLUMN_LIST constructor. e.g. the ROW() call in "SELECT * FROM TABLE(DEDUP(CURSOR(SELECT * FROM EMPS), ROW(name, empno)))".
    • UNNEST

      public static final SqlUnnestOperator UNNEST
      The UNNEST operator.
    • UNNEST_WITH_ORDINALITY

      public static final SqlUnnestOperator UNNEST_WITH_ORDINALITY
      The UNNEST WITH ORDINALITY operator.
    • LATERAL

      public static final SqlSpecialOperator LATERAL
      The LATERAL operator.
    • COLLECTION_TABLE

      public static final SqlSpecialOperator COLLECTION_TABLE
      The "table function derived table" operator, which a table-valued function into a relation, e.g. "SELECT * FROM TABLE(ramp(5))".

      This operator has function syntax (with one argument), whereas EXPLICIT_TABLE is a prefix operator.

    • OVERLAPS

      public static final SqlOverlapsOperator OVERLAPS
    • CONTAINS

      public static final SqlOverlapsOperator CONTAINS
    • PRECEDES

      public static final SqlOverlapsOperator PRECEDES
    • IMMEDIATELY_PRECEDES

      public static final SqlOverlapsOperator IMMEDIATELY_PRECEDES
    • SUCCEEDS

      public static final SqlOverlapsOperator SUCCEEDS
    • IMMEDIATELY_SUCCEEDS

      public static final SqlOverlapsOperator IMMEDIATELY_SUCCEEDS
    • PERIOD_EQUALS

      public static final SqlOverlapsOperator PERIOD_EQUALS
    • VALUES

      public static final SqlSpecialOperator VALUES
    • LITERAL_CHAIN

      public static final SqlLiteralChainOperator LITERAL_CHAIN
    • THROW

      public static final SqlThrowOperator THROW
    • JSON_EXISTS

      public static final SqlFunction JSON_EXISTS
    • JSON_VALUE

      public static final SqlFunction JSON_VALUE
    • JSON_QUERY

      public static final SqlFunction JSON_QUERY
    • JSON_OBJECT

      public static final SqlFunction JSON_OBJECT
    • JSON_OBJECTAGG

      public static final SqlJsonObjectAggAggFunction JSON_OBJECTAGG
    • JSON_ARRAY

      public static final SqlFunction JSON_ARRAY
    • JSON_TYPE

      @Deprecated public static final SqlFunction JSON_TYPE
      Deprecated.
    • JSON_DEPTH

      @Deprecated public static final SqlFunction JSON_DEPTH
      Deprecated.
    • JSON_LENGTH

      @Deprecated public static final SqlFunction JSON_LENGTH
      Deprecated.
    • JSON_KEYS

      @Deprecated public static final SqlFunction JSON_KEYS
      Deprecated.
    • JSON_PRETTY

      @Deprecated public static final SqlFunction JSON_PRETTY
      Deprecated.
    • JSON_REMOVE

      @Deprecated public static final SqlFunction JSON_REMOVE
      Deprecated.
    • JSON_STORAGE_SIZE

      @Deprecated public static final SqlFunction JSON_STORAGE_SIZE
      Deprecated.
    • JSON_INSERT

      @Deprecated public static final SqlFunction JSON_INSERT
      Deprecated.
    • JSON_REPLACE

      @Deprecated public static final SqlFunction JSON_REPLACE
      Deprecated.
    • JSON_SET

      @Deprecated public static final SqlFunction JSON_SET
      Deprecated.
    • JSON_ARRAYAGG

      public static final SqlJsonArrayAggAggFunction JSON_ARRAYAGG
    • BETWEEN

      public static final SqlBetweenOperator BETWEEN
    • SYMMETRIC_BETWEEN

      public static final SqlBetweenOperator SYMMETRIC_BETWEEN
    • NOT_BETWEEN

      public static final SqlBetweenOperator NOT_BETWEEN
    • SYMMETRIC_NOT_BETWEEN

      public static final SqlBetweenOperator SYMMETRIC_NOT_BETWEEN
    • NOT_LIKE

      public static final SqlSpecialOperator NOT_LIKE
    • LIKE

      public static final SqlSpecialOperator LIKE
    • NOT_SIMILAR_TO

      public static final SqlSpecialOperator NOT_SIMILAR_TO
    • SIMILAR_TO

      public static final SqlSpecialOperator SIMILAR_TO
    • POSIX_REGEX_CASE_SENSITIVE

      public static final SqlBinaryOperator POSIX_REGEX_CASE_SENSITIVE
    • POSIX_REGEX_CASE_INSENSITIVE

      public static final SqlBinaryOperator POSIX_REGEX_CASE_INSENSITIVE
    • NEGATED_POSIX_REGEX_CASE_SENSITIVE

      public static final SqlBinaryOperator NEGATED_POSIX_REGEX_CASE_SENSITIVE
    • NEGATED_POSIX_REGEX_CASE_INSENSITIVE

      public static final SqlBinaryOperator NEGATED_POSIX_REGEX_CASE_INSENSITIVE
    • ESCAPE

      public static final SqlSpecialOperator ESCAPE
      Internal operator used to represent the ESCAPE clause of a LIKE or SIMILAR TO expression.
    • CASE

      public static final SqlCaseOperator CASE
    • PROCEDURE_CALL

      public static final SqlOperator PROCEDURE_CALL
    • NEW

      public static final SqlOperator NEW
    • OVER

      public static final SqlBinaryOperator OVER
      The OVER operator, which applies an aggregate functions to a window.

      Operands are as follows:

      1. name of window function (SqlCall)
      2. window name (SqlLiteral) or window in-line specification (org.apache.calcite.sql.SqlWindow.SqlWindowOperator)
    • REINTERPRET

      public static final SqlSpecialOperator REINTERPRET
      An REINTERPRET operator is internal to the planner. When the physical storage of two types is the same, this operator may be used to reinterpret values of one type as the other. This operator is similar to a cast, except that it does not alter the data value. Like a regular cast it accepts one operand and stores the target type as the return type. It performs an overflow check if it has any second operand, whether true or not.
    • SUBSTRING

      public static final SqlFunction SUBSTRING
      The character substring function: SUBSTRING(string FROM start [FOR length]).

      If the length parameter is a constant, the length of the result is the minimum of the length of the input and that length. Otherwise it is the length of the input.

    • REPLACE

      public static final SqlFunction REPLACE
      The REPLACE(string, search, replace) function. Not standard SQL, but in Oracle and Postgres.
    • CONVERT

      public static final SqlFunction CONVERT
      The CONVERT(charValue, srcCharsetName, destCharsetName) function converts charValue with destCharsetName, whose original encoding is specified by srcCharsetName.

      The SQL standard defines CONVERT(charValue USING transcodingName), and MySQL implements it; Calcite supports this in the following TRANSLATE function.

      MySQL and Microsoft SQL Server have a CONVERT(type, value) function; Calcite does not currently support this, either.

    • TRANSLATE

      public static final SqlFunction TRANSLATE
      The TRANSLATE/CONVERT(char_value USING transcodingName) function alters the character set of a string value from one base character set to transcodingName.

      It is defined in the SQL standard. See also the non-standard SqlLibraryOperators.TRANSLATE3, which has a different purpose.

    • OVERLAY

      public static final SqlFunction OVERLAY
    • TRIM

      public static final SqlFunction TRIM
      The "TRIM" function.
    • POSITION

      public static final SqlFunction POSITION
    • CHAR_LENGTH

      public static final SqlBasicFunction CHAR_LENGTH
    • CHARACTER_LENGTH

      public static final SqlFunction CHARACTER_LENGTH
      Alias for CHAR_LENGTH.
    • OCTET_LENGTH

      public static final SqlFunction OCTET_LENGTH
    • UPPER

      public static final SqlFunction UPPER
    • LOWER

      public static final SqlFunction LOWER
    • INITCAP

      public static final SqlFunction INITCAP
    • ASCII

      public static final SqlFunction ASCII
    • POWER

      public static final SqlBasicFunction POWER
      The POWER(numeric, numeric) function.

      The return type is always DOUBLE since we don't know what the result type will be by just looking at the operand types. For example POWER(INTEGER, INTEGER) can return a non-INTEGER if the second operand is negative.

    • SQRT

      public static final SqlFunction SQRT
      The SQRT(numeric) function.
    • MOD

      public static final SqlFunction MOD
      Arithmetic remainder function MOD.
      See Also:
    • LN

      public static final SqlFunction LN
      The LN(numeric) function.
    • LOG10

      public static final SqlFunction LOG10
      The LOG10(numeric) function.
    • ABS

      public static final SqlFunction ABS
      The ABS(numeric) function.
    • ACOS

      public static final SqlFunction ACOS
      The ACOS(numeric) function.
    • ASIN

      public static final SqlFunction ASIN
      The ASIN(numeric) function.
    • ATAN

      public static final SqlFunction ATAN
      The ATAN(numeric) function.
    • ATAN2

      public static final SqlFunction ATAN2
      The ATAN2(numeric, numeric) function.
    • CBRT

      public static final SqlFunction CBRT
      The CBRT(numeric) function.
    • COS

      public static final SqlFunction COS
      The COS(numeric) function.
    • COT

      public static final SqlFunction COT
      The COT(numeric) function.
    • DEGREES

      public static final SqlFunction DEGREES
      The DEGREES(numeric) function.
    • EXP

      public static final SqlFunction EXP
      The EXP(numeric) function.
    • RADIANS

      public static final SqlFunction RADIANS
      The RADIANS(numeric) function.
    • ROUND

      public static final SqlFunction ROUND
      The ROUND(numeric [, numeric]) function.
    • SIGN

      public static final SqlFunction SIGN
      The SIGN(numeric) function.
    • SIN

      public static final SqlFunction SIN
      The SIN(numeric) function.
    • TAN

      public static final SqlFunction TAN
      The TAN(numeric) function.
    • TRUNCATE

      public static final SqlBasicFunction TRUNCATE
      The TRUNCATE(numeric [, numeric]) function.
    • PI

      public static final SqlFunction PI
      The PI function.
    • FIRST

      public static final SqlFunction FIRST
      FIRST function to be used within MATCH_RECOGNIZE.
    • LAST

      public static final SqlMatchFunction LAST
      LAST function to be used within MATCH_RECOGNIZE.
    • PREV

      public static final SqlMatchFunction PREV
      PREV function to be used within MATCH_RECOGNIZE.
    • NEXT

      public static final SqlFunction NEXT
      NEXT function to be used within MATCH_RECOGNIZE.
    • CLASSIFIER

      public static final SqlMatchFunction CLASSIFIER
      CLASSIFIER function to be used within MATCH_RECOGNIZE.
    • MATCH_NUMBER

      public static final SqlFunction MATCH_NUMBER
      MATCH_NUMBER function to be used within MATCH_RECOGNIZE.
    • NULLIF

      public static final SqlFunction NULLIF
    • COALESCE

      public static final SqlFunction COALESCE
      The COALESCE builtin function.
    • FLOOR

      public static final SqlFunction FLOOR
      The FLOOR function.
    • CEIL

      public static final SqlFunction CEIL
      The CEIL function.
    • USER

      public static final SqlFunction USER
      The USER function.
    • CURRENT_USER

      public static final SqlFunction CURRENT_USER
      The CURRENT_USER function.
    • SESSION_USER

      public static final SqlFunction SESSION_USER
      The SESSION_USER function.
    • SYSTEM_USER

      public static final SqlFunction SYSTEM_USER
      The SYSTEM_USER function.
    • CURRENT_PATH

      public static final SqlFunction CURRENT_PATH
      The CURRENT_PATH function.
    • CURRENT_ROLE

      public static final SqlFunction CURRENT_ROLE
      The CURRENT_ROLE function.
    • CURRENT_CATALOG

      public static final SqlFunction CURRENT_CATALOG
      The CURRENT_CATALOG function.
    • CURRENT_SCHEMA

      public static final SqlFunction CURRENT_SCHEMA
      The CURRENT_SCHEMA function.
    • LOCALTIME

      public static final SqlFunction LOCALTIME
      The LOCALTIME [(precision)] function.
    • LOCALTIMESTAMP

      public static final SqlFunction LOCALTIMESTAMP
      The LOCALTIMESTAMP [(precision)] function.
    • CURRENT_TIME

      public static final SqlFunction CURRENT_TIME
      The CURRENT_TIME [(precision)] function.
    • CURRENT_TIMESTAMP

      public static final SqlFunction CURRENT_TIMESTAMP
      The CURRENT_TIMESTAMP [(precision)] function.
    • CURRENT_DATE

      public static final SqlFunction CURRENT_DATE
      The CURRENT_DATE function.
    • TIMESTAMP_ADD

      public static final SqlFunction TIMESTAMP_ADD
      The TIMESTAMPADD function.
    • TIMESTAMP_DIFF

      public static final SqlFunction TIMESTAMP_DIFF
      The TIMESTAMPDIFF function.
    • IN_FENNEL

      public static final SqlFunction IN_FENNEL
      Use of the IN_FENNEL operator forces the argument to be evaluated in Fennel. Otherwise acts as identity function.
    • CAST

      public static final SqlFunction CAST
      The SQL CAST operator.

      The SQL syntax is

      CAST(expression AS type)

      When the CAST operator is applies as a SqlCall, it has two arguments: the expression and the type. The type must not include a constraint, so CAST(x AS INTEGER NOT NULL), for instance, is invalid.

      When the CAST operator is applied as a RexCall, the target type is simply stored as the return type, not an explicit operand. For example, the expression CAST(1 + 2 AS DOUBLE) will become a call to CAST with the expression 1 + 2 as its only operand.

      The RexCall form can also have a type which contains a NOT NULL constraint. When this expression is implemented, if the value is NULL, an exception will be thrown.

    • EXTRACT

      public static final SqlFunction EXTRACT
      The SQL EXTRACT operator. Extracts a specified field value from a DATETIME or an INTERVAL. E.g.
      EXTRACT(HOUR FROM INTERVAL '364 23:59:59') returns 23
    • YEAR

      public static final SqlDatePartFunction YEAR
      The SQL YEAR operator. Returns the Year from a DATETIME E.g.
      YEAR(date '2008-9-23') returns 2008
    • QUARTER

      public static final SqlDatePartFunction QUARTER
      The SQL QUARTER operator. Returns the Quarter from a DATETIME E.g.
      QUARTER(date '2008-9-23') returns 3
    • MONTH

      public static final SqlDatePartFunction MONTH
      The SQL MONTH operator. Returns the Month from a DATETIME E.g.
      MONTH(date '2008-9-23') returns 9
    • WEEK

      public static final SqlDatePartFunction WEEK
      The SQL WEEK operator. Returns the Week from a DATETIME E.g.
      WEEK(date '2008-9-23') returns 39
    • DAYOFYEAR

      public static final SqlDatePartFunction DAYOFYEAR
      The SQL DAYOFYEAR operator. Returns the DOY from a DATETIME E.g.
      DAYOFYEAR(date '2008-9-23') returns 267
    • DAYOFMONTH

      public static final SqlDatePartFunction DAYOFMONTH
      The SQL DAYOFMONTH operator. Returns the Day from a DATETIME E.g.
      DAYOFMONTH(date '2008-9-23') returns 23
    • DAYOFWEEK

      public static final SqlDatePartFunction DAYOFWEEK
      The SQL DAYOFWEEK operator. Returns the DOW from a DATETIME E.g.
      DAYOFWEEK(date '2008-9-23') returns 2
    • HOUR

      public static final SqlDatePartFunction HOUR
      The SQL HOUR operator. Returns the Hour from a DATETIME E.g.
      HOUR(timestamp '2008-9-23 01:23:45') returns 1
    • MINUTE

      public static final SqlDatePartFunction MINUTE
      The SQL MINUTE operator. Returns the Minute from a DATETIME E.g.
      MINUTE(timestamp '2008-9-23 01:23:45') returns 23
    • SECOND

      public static final SqlDatePartFunction SECOND
      The SQL SECOND operator. Returns the Second from a DATETIME E.g.
      SECOND(timestamp '2008-9-23 01:23:45') returns 45
    • LAST_DAY

      public static final SqlFunction LAST_DAY
      The LAST_DAY(date) function.
    • ELEMENT

      public static final SqlFunction ELEMENT
      The ELEMENT operator, used to convert a multiset with only one item to a "regular" type. Example ... log(ELEMENT(MULTISET[1])) ...
    • ITEM

      public static final SqlOperator ITEM
      The item operator [ ... ], used to access a given element of an array, map or struct. For example, myArray[3], "myMap['foo']", myStruct[2] or myStruct['fieldName'].

      The SQL standard calls the ARRAY variant a <array element reference>. Index is 1-based. The standard says to raise "data exception - array element error" but we currently return null.

      MAP is not standard SQL.

    • ARRAY_VALUE_CONSTRUCTOR

      public static final SqlArrayValueConstructor ARRAY_VALUE_CONSTRUCTOR
      The ARRAY Value Constructor. e.g. "ARRAY[1, 2, 3]".
    • MAP_VALUE_CONSTRUCTOR

      public static final SqlMapValueConstructor MAP_VALUE_CONSTRUCTOR
      The MAP Value Constructor, e.g. "MAP['washington', 1, 'obama', 44]".
    • SLICE

      public static final SqlInternalOperator SLICE
      The internal "$SLICE" operator takes a multiset of records and returns a multiset of the first column of those records.

      It is introduced when multisets of scalar types are created, in order to keep types consistent. For example, MULTISET [5] has type INTEGER MULTISET but is translated to an expression of type RECORD(INTEGER EXPR$0) MULTISET because in our internal representation of multisets, every element must be a record. Applying the "$SLICE" operator to this result converts the type back to an INTEGER MULTISET multiset value.

      $SLICE is often translated away when the multiset type is converted back to scalar values.

    • ELEMENT_SLICE

      public static final SqlInternalOperator ELEMENT_SLICE
      The internal "$ELEMENT_SLICE" operator returns the first field of the only element of a multiset.

      It is introduced when multisets of scalar types are created, in order to keep types consistent. For example, ELEMENT(MULTISET [5]) is translated to $ELEMENT_SLICE(MULTISET (VALUES ROW (5 EXPR$0)) It is translated away when the multiset type is converted back to scalar values.

      NOTE: jhyde, 2006/1/9: Usages of this operator are commented out, but I'm not deleting the operator, because some multiset tests are disabled, and we may need this operator to get them working!

    • SCALAR_QUERY

      public static final SqlInternalOperator SCALAR_QUERY
      The internal "$SCALAR_QUERY" operator returns a scalar value from a record type. It assumes the record type only has one field, and returns that field as the output.
    • STRUCT_ACCESS

      public static final SqlInternalOperator STRUCT_ACCESS
      The internal $STRUCT_ACCESS operator is used to access a field of a record.

      In contrast with DOT operator, it never appears in an SqlNode tree and allows to access fields by position and not by name.

    • CARDINALITY

      public static final SqlFunction CARDINALITY
      The CARDINALITY operator, used to retrieve the number of elements in a MULTISET, ARRAY or MAP.
    • COLLECT

      public static final SqlAggFunction COLLECT
      The COLLECT operator. Multiset aggregator function.
    • PERCENTILE_CONT

      public static final SqlAggFunction PERCENTILE_CONT
      PERCENTILE_CONT inverse distribution aggregate function.

      The argument must be a numeric literal in the range 0 to 1 inclusive (representing a percentage), and the return type is the type of the ORDER BY expression.

    • PERCENTILE_DISC

      public static final SqlAggFunction PERCENTILE_DISC
      PERCENTILE_DISC inverse distribution aggregate function.

      The argument must be a numeric literal in the range 0 to 1 inclusive (representing a percentage), and the return type is the type of the ORDER BY expression.

    • LISTAGG

      public static final SqlAggFunction LISTAGG
      The LISTAGG operator. String aggregator function.
    • FUSION

      public static final SqlAggFunction FUSION
      The FUSION operator. Multiset aggregator function.
    • INTERSECTION

      public static final SqlAggFunction INTERSECTION
      The INTERSECTION operator. Multiset aggregator function.
    • NEXT_VALUE

      public static final SqlOperator NEXT_VALUE
      The sequence next value function: NEXT VALUE FOR sequence.
    • CURRENT_VALUE

      public static final SqlOperator CURRENT_VALUE
      The sequence current value function: CURRENT VALUE FOR sequence.
    • TABLESAMPLE

      public static final SqlSpecialOperator TABLESAMPLE
      The TABLESAMPLE operator.

      Examples:

      • <query> TABLESAMPLE SUBSTITUTE('sampleName') (non-standard)
      • <query> TABLESAMPLE BERNOULLI(<percent>) [REPEATABLE(<seed>)] (standard, but not implemented for FTRS yet)
      • <query> TABLESAMPLE SYSTEM(<percent>) [REPEATABLE(<seed>)] (standard, but not implemented for FTRS yet)

      Operand #0 is a query or table; Operand #1 is a SqlSampleSpec wrapped in a SqlLiteral.

    • DESCRIPTOR

      public static final SqlOperator DESCRIPTOR
      DESCRIPTOR(column_name, ...).
    • TUMBLE

      public static final SqlFunction TUMBLE
      TUMBLE as a table function.
    • HOP

      public static final SqlFunction HOP
      HOP as a table function.
    • SESSION

      public static final SqlFunction SESSION
      SESSION as a table function.
    • TUMBLE_OLD

      public static final SqlGroupedWindowFunction TUMBLE_OLD
      The TUMBLE group function.

      This operator is named "$TUMBLE" (not "TUMBLE") because it is created directly by the parser, not by looking up an operator by name.

      Why did we add TUMBLE to the parser? Because we plan to support TUMBLE as a table function (see [CALCITE-3272]); "TUMBLE" as a name will only be used by the TUMBLE table function.

      After the TUMBLE table function is introduced, we plan to deprecate this TUMBLE group function, and in fact all group functions. See [CALCITE-3340] for details.

    • TUMBLE_START

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

      public static final SqlGroupedWindowFunction TUMBLE_END
      The TUMBLE_END auxiliary function of the TUMBLE group function.
    • HOP_OLD

      public static final SqlGroupedWindowFunction HOP_OLD
      The HOP group function.
    • HOP_START

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

      public static final SqlGroupedWindowFunction HOP_END
      The HOP_END auxiliary function of the HOP group function.
    • SESSION_OLD

      public static final SqlGroupedWindowFunction SESSION_OLD
      The SESSION group function.
    • SESSION_START

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

      public static final SqlGroupedWindowFunction SESSION_END
      The SESSION_END auxiliary function of the SESSION group function.
    • PATTERN_ALTER

      public static final SqlBinaryOperator PATTERN_ALTER
      | operator to create alternate patterns within MATCH_RECOGNIZE.

      If p1 and p2 are patterns then p1 | p2 is a pattern that matches p1 or p2.

    • PATTERN_CONCAT

      public static final SqlBinaryOperator PATTERN_CONCAT
      Operator to concatenate patterns within MATCH_RECOGNIZE.

      If p1 and p2 are patterns then p1 p2 is a pattern that matches p1 followed by p2.

    • PATTERN_QUANTIFIER

      public static final SqlSpecialOperator PATTERN_QUANTIFIER
      Operator to quantify patterns within MATCH_RECOGNIZE.

      If p is a pattern then p{3, 5} is a pattern that matches between 3 and 5 occurrences of p.

    • PATTERN_PERMUTE

      public static final SqlSpecialOperator PATTERN_PERMUTE
      PERMUTE operator to combine patterns within MATCH_RECOGNIZE.

      If p1 and p2 are patterns then PERMUTE (p1, p2) is a pattern that matches all permutations of p1 and p2.

    • PATTERN_EXCLUDE

      public static final SqlSpecialOperator PATTERN_EXCLUDE
      EXCLUDE operator within MATCH_RECOGNIZE.

      If p is a pattern then {- p -} } is a pattern that excludes p from the output.

    • SET_SEMANTICS_TABLE

      public static final SqlInternalOperator SET_SEMANTICS_TABLE
      SetSemanticsTable represents as an input table with set semantics.
    • operators

      protected com.google.common.collect.ImmutableMultimap<String,SqlOperator> operators
      Contains all (name, operator) pairs. Effectively a sorted immutable multimap.

      There can be several operators with the same name (case-insensitive or case-sensitive) and these operators will lie in a contiguous range which we can find efficiently using binary search.

  • Constructor Details

    • SqlStdOperatorTable

      public SqlStdOperatorTable()
  • Method Details

    • instance

      public static SqlStdOperatorTable instance()
      Returns the standard operator table, creating it if necessary.
    • lookUpOperators

      protected void lookUpOperators(String name, boolean caseSensitive, Consumer<SqlOperator> consumer)
      Looks up operators, optionally matching case-sensitively.
    • auxiliaryToGroup

      public static @Nullable SqlGroupedWindowFunction auxiliaryToGroup(SqlKind kind)
      Returns the group function for which a given kind is an auxiliary function, or null if it is not an auxiliary function.
    • convertAuxiliaryToGroupCall

      public static @Nullable SqlCall convertAuxiliaryToGroupCall(SqlCall call)
      Converts a call to a grouped auxiliary function to a call to the grouped window function. For other calls returns null.

      For example, converts TUMBLE_START(rowtime, INTERVAL '1' HOUR)) to TUMBLE(rowtime, INTERVAL '1' HOUR)).

    • convertGroupToAuxiliaryCalls

      @Deprecated public static List<Pair<SqlNode,AuxiliaryConverter>> convertGroupToAuxiliaryCalls(SqlCall call)
      Deprecated.
      Converts a call to a grouped window function to a call to its auxiliary window function(s).
    • convertGroupToAuxiliaryCalls

      public static void convertGroupToAuxiliaryCalls(SqlCall call, BiConsumer<SqlNode,AuxiliaryConverter> consumer)
      Converts a call to a grouped window function to a call to its auxiliary window function(s).

      For example, converts TUMBLE_START(rowtime, INTERVAL '1' HOUR)) to TUMBLE(rowtime, INTERVAL '1' HOUR)).

    • some

      public static SqlQuantifyOperator some(SqlKind comparisonKind)
      Returns the operator for SOME comparisonKind.
    • all

      public static SqlQuantifyOperator all(SqlKind comparisonKind)
      Returns the operator for ALL comparisonKind.
    • reverse

      @Deprecated public static SqlOperator reverse(SqlOperator operator)
      Deprecated.
      Use SqlOperator.reverse(), but beware that it has slightly different semantics
      Returns the binary operator that corresponds to this operator but in the opposite direction. Or returns this, if its kind is not reversible.

      For example, reverse(GREATER_THAN) returns LESS_THAN.

    • like

      public static SqlOperator like(boolean negated, boolean caseSensitive)
      Returns the operator for LIKE with given case-sensitivity, optionally negated.
    • floorCeil

      public static SqlOperator floorCeil(boolean floor, SqlConformance conformance)
      Returns the operator for FLOOR and CEIL with given floor flag and library.
    • getOperatorList

      public List<SqlOperator> getOperatorList()
      Description copied from interface: SqlOperatorTable
      Retrieves a list of all functions and operators in this table. Used for automated testing. Depending on the table type, may or may not be mutable.
      Specified by:
      getOperatorList in interface SqlOperatorTable
      Returns:
      list of SqlOperator objects
    • setOperators

      protected void setOperators(com.google.common.collect.Multimap<String,SqlOperator> operators)
    • buildIndex

      protected static com.google.common.collect.ImmutableMultimap<String,SqlOperator> buildIndex(Iterable<? extends SqlOperator> operators)
      Derives a value to be assigned to operators from a given list of operators.