Enum SqlKind
- All Implemented Interfaces:
Serializable
,Comparable<SqlKind>
,Constable
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()) { caseEQUALS
: ...; caseNOT_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.)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionADD_MONTHS
function (Oracle, Spark).AGG_M2M
(aggregate measure to measure) internal aggregate function.AGG_M2V
(aggregate measure to value) internal aggregate function.TheAGGREGATE
aggregate function.ALL
quantification operator.ALTER INDEX
DDL statement.ALTER MATERIALIZED VIEW
DDL statement.ALTER SEQUENCE
DDL statement.ALTER SESSION
DDL statement.ALTER TABLE
DDL statement.ALTER VIEW
DDL statement.Logical "AND" operator.TheANY_VALUE
aggregate function.TheARG_MAX
aggregate function.TheARG_MIN
aggregate function.Argument assignment operator,=>
.TheARRAY_AGG
aggregate function.ARRAY_APPEND
function (Spark semantics).ARRAY_COMPACT
function (Spark semantics).ARRAY_CONCAT
function (BigQuery semantics).TheARRAY_CONCAT_AGG
aggregate function.ARRAY_CONTAINS
function (Spark semantics).ARRAY_DISTINCT
function (Spark semantics).ARRAY_EXCEPT
function (Spark semantics).ARRAY_INSERT
function (Spark semantics).ARRAY_INTERSECT
function (Spark semantics).ARRAY_JOIN
function (Spark semantics).ARRAY_LENGTH
function (Spark semantics).ARRAY_MAX
function (Spark semantics).ARRAY_MIN
function (Spark semantics).ARRAY_POSITION
function (Spark semantics).ARRAY_PREPEND
function (Spark semantics).Array Query Constructor, e.g.ARRAY_REMOVE
function (Spark semantics).ARRAY_REPEAT
function (Spark semantics).ARRAY_REVERSE
function (BigQuery semantics).ARRAY_SIZE
function (Spark semantics).ARRAY_TO_STRING
function (BigQuery semantics).ARRAY_UNION
function (Spark semantics).Array Value Constructor, e.g.ARRAYS_OVERLAP
function (Spark semantics).ARRAYS_ZIP
function (Spark semantics).AS
operator.Attribute definition.TheAVG
aggregate function.BETWEEN
operator.TheBIT_AND
aggregate function.TheBIT_OR
aggregate function.TheBIT_XOR
aggregate function.TheBITAND
scalar function.TheBITNOT
scalar function.TheBITOR
scalar function.TheBITXOR
scalar function.CASE
expression.The "CAST" operator, and also the PostgreSQL-style infix cast operator "::".CEIL
function.CHAR_LENGTH
function.CHECK
constraint.CLASSIFIER
operator inMATCH_RECOGNIZE
.COALESCE
operator.TheCOLLECT
aggregate function.Table operator which converts user-defined transform into a relation, for example,select * from TABLE(udx(x, y, z))
.Column declaration.The non-standard constructor used to pass a COLUMN_LIST parameter to a user-defined transform.COMMIT
session control statement.TheCONCAT
function (Postgresql and MSSQL) that ignores NULL.TheCONCAT_WS
function (MSSQL).TheCONCAT_WS
function (Postgresql).TheCONCAT_WS
function (Spark).The two-argumentCONCAT
function (Oracle).CONTAINS
operator for periods.CONTAINS_SUBSTR
function (BigQuery semantics).CONVERT
function.Reference to correlation variable.TheCOUNT
aggregate function.TheCOUNTIF
aggregate function.TheCOVAR_POP
aggregate function.TheCOVAR_SAMP
aggregate function.CREATE FOREIGN SCHEMA
DDL statement.CREATE FUNCTION
DDL statement.CREATE INDEX
DDL statement.CREATE MATERIALIZED VIEW
DDL statement.CREATE SCHEMA
DDL statement.CREATE SEQUENCE
DDL statement.CREATE TABLE
DDL statement.CREATE TABLE LIKE
DDL statement.CREATE TYPE
DDL statement.CREATE VIEW
DDL statement.The internalCUBE
operator that occurs within aGROUP BY
clause.TheROW_NUMBER
window function.The "CURRENT VALUE OF sequence" operator.CURSOR
constructor, for example,SELECT * FROM TABLE(udx(CURSOR(SELECT ...), x, y, z))
.DATE_ADD
function (BigQuery Semantics).DATE_SUB
function (BigQuery).DATE_TRUNC
function (BigQuery).DECODE
function (Oracle).DEFAULT
operator.DELETE statement.TheDENSE_RANK
window function.DESC
operator inORDER BY
.DESCRIBE SCHEMA statement.DESCRIBE TABLE statement.TheDESCRIPTOR(column_name, ...)
.Arithmetic division operator, "/".Dot.DROP FUNCTION
DDL statement.DROP INDEX
DDL statement.DROP MATERIALIZED VIEW
DDL statement.DROP SCHEMA
DDL statement.DROP SEQUENCE
DDL statement.DROP TABLE
DDL statement.DROP TYPE
DDL statement.DROP VIEW
DDL statement.Variant ofBETWEEN
for the Druid adapter.Variant ofIN
for the Druid adapter.Variant ofNOT_IN
for the Druid adapter.A dynamic parameter.ENDS_WITH
function.Equals operator, "=".Escape operator (always part of LIKE or SIMILAR TO expression).EXCEPT
relational operator (known asMINUS
in some SQL dialects).EXISTS
operator.EXPLAIN statement.Explicit table, e.g.The internalEXTEND
operator that qualifies a table name in theFROM
clause.EXTRACT
function.The field access operator, ".".FILTER
operator.FINAL
operator inMATCH_RECOGNIZE
.FIRST
operator inMATCH_RECOGNIZE
.TheFIRST_VALUE
aggregate function.FLOOR
function.FOLLOWING
qualifier of an interval end-point in a window specification.FOREIGN KEY
constraint.TheFUSION
aggregate function.Greater-than operator, ">".Greater-than-or-equal operator, ">=".GREATEST
function (Oracle, Spark).GREATEST
function (PostgreSQL).The DISTINCT keyword of the GROUP BY clause.TheGROUP_CONCAT
aggregate function.TheGROUP_ID()
function.TheGROUPING(e, ...)
function.Deprecated.The internalGROUPING SETS
operator that occurs within aGROUP BY
clause.TheHilbert
function that converts (x, y) to a position on a Hilbert space-filling curve.Sql Hint statement.TheHOP
group function.TheHOP_END
auxiliary function of theHOP
group function.TheHOP_START
auxiliary function of theHOP
group function.An identifier.The "IF" function (BigQuery, Hive, Spark).IGNORE NULLS
operator.IMMEDIATELY PRECEDES
operator for periods.IMMEDIATELY SUCCEEDS
operator for periods.IN
operator.Reference to an input field.INSERT statement.INTERSECT
relational operator.TheINTERSECTION
aggregate function.INTERVAL
expression.Interval qualifier.IS DISTINCT FROM
operator.IS FALSE
operator.IS NOT DISTINCT FROM
operator.IS NOT FALSE
operator.IS NOT NULL
operator.IS NOT TRUE
operator.IS NULL
operator.IS TRUE
operator.IS UNKNOWN
operator.Item expression.Call to a function using JDBC function syntax.JOIN operator or compound FROM clause.JSON_ARRAYAGG
aggregate function.JSON_OBJECTAGG
aggregate function.JSON
type function.JSON
value expression.TheLAG
aggregate function.LAMBDA
expression.Reference to lambda expression parameter.LAST
operator inMATCH_RECOGNIZE
.TheLAST_VALUE
aggregate function.The "LATERAL" qualifier to relations in the FROM clause.TheLEAD
aggregate function.LEAST
function (Oracle).LEAST
function (PostgreSQL).Less-than operator, "<".Less-than-or-equal operator, "<=".LIKE
operator.TheLISTAGG
aggregate function.A literal.TheLITERAL_AGG
aggregate function that always returns the same literal (even if the group is empty).Literal chain operator (for composite string literals).Reference to a sub-expression computed within the current relational operator.LOG
function.LTRIM
function (Oracle).M2V
(measure-to-value) internal operator.M2X
(evaluate measure in context) internal operator.MAP_CONCAT
function (Spark semantics).MAP_CONTAINS_KEY
function (Spark semantics).MAP_ENTRIES
function (Spark semantics).MAP_FROM_ARRAYS
function (Spark semantics).MAP_FROM_ENTRIES
function (Spark semantics).MAP_KEYS
function (Spark semantics).MAP query constructor, e.g.MAP value constructor, e.g.MAP_VALUES
function (Spark semantics).MATCH_NUMBER
operator inMATCH_RECOGNIZE
.MATCH_RECOGNIZE clause.TheMAX
aggregate function.MEASURE
operator.MERGE statement.TheMIN
aggregate function.Arithmetic minus operator, "-".Unary minus operator, as in "-1".Arithmetic remainder operator, "MOD" (and "%" in some dialects).TheMODE
aggregate function.MULTISET
query constructor.MULTISET
value constructor.New specification.NEXT
operator inMATCH_RECOGNIZE
.The "NEXT VALUE OF sequence" operator.LogicalNOT
operator.Not-equals operator, "!=" or "<>".NOT IN
operator.TheNTH_VALUE
aggregate function.TheNTILE
aggregate function.NULLIF
operator.NULLS FIRST
clause inORDER BY
.NULLS LAST
clause inORDER BY
.NVL
function (Oracle, Spark).NVL2
function (Oracle, Spark).Logical "OR" operator.ORDER BY clause.Expression not covered by any otherSqlKind
value.DDL statement not handled above.Function that is not a special function.OVER
operator.OVERLAPS
operator for periods.Alternation operator in a pattern expression within aMATCH_RECOGNIZE
clause.Concatenation operator in a pattern expression within aMATCH_RECOGNIZE
clause.The special patterns to exclude enclosing pattern from output in a MATCH_RECOGNIZE clause.Reference to an input field, with pattern var as modifier.The internal "permute" function in a MATCH_RECOGNIZE clause.the repetition quantifier of a pattern factor in a match_recognize clause.ThePERCENT_RANK
window function.ThePERCENTILE_CONT
aggregate function.ThePERCENTILE_DISC
aggregate function.EQUALS
operator for periods.PIVOT clause.Arithmetic plus operator, "+".Unary plus operator, as in "+1".POSITION function.~*
operator (for case-insensitive POSIX-style regular expressions).~
operator (for POSIX-style regular expressions).PRECEDES
operator for periods.PRECEDING
qualifier of an interval end-point in a window specification.PREV
operator inMATCH_RECOGNIZE
.PRIMARY KEY
constraint.Procedure call.TheRANK
window function.TheREGR_COUNT
aggregate function.TheREGR_SXX
aggregate function.TheREGR_SYY
aggregate function.The internal REINTERPRET operator (meaning a reinterpret cast).RESPECT NULLS
operator.REVERSE
function (SQL Server, MySQL).REVERSE
function (Spark semantics).RLIKE
operator.ROLLBACK
session control statement.The internalROLLUP
operator that occurs within aGROUP BY
clause.The row-constructor function.TheROW_NUMBER
window function.RTRIM
function (Oracle).FINAL
operator inMATCH_RECOGNIZE
.TheSAFE_CAST
function, which is similar toCAST
but returns NULL rather than throwing an error if the conversion fails.SAME_PARTITION
pseudo-function.Scalar query; that is, a sub-query used in an expression context, and returning one row and one column.SEARCH
operator.SELECT statement or sub-query.SEPARATOR
expression.TheSESSION
group function.TheSESSION_END
auxiliary function of theSESSION
group function.TheSESSION_START
auxiliary function of theSESSION
group function."ALTER scope SET option = value
" statement.Input tables have either row semantics or set semantics.SIMILAR
operator.TheSINGLE_VALUE
aggregate function.SKIP TO FIRST
qualifier of restarting point in aMATCH_RECOGNIZE
clause.SKIP TO LAST
qualifier of restarting point in aMATCH_RECOGNIZE
clause.SNAPSHOT operator.SOME
quantification operator (also calledANY
).SORT_ARRAY
function (Spark semantics).SOUNDEX
function (Spark semantics).TheST_Contains
function that tests whether one geometry contains another.TheST_DWithin
geo-spatial function.TheST_MakeLine
function that makes a line.TheST_Point
function.TheST_Point
function that makes a 3D point.STARTS_WITH
function.TheSTDDEV_POP
aggregate function.TheSTDDEV_SAMP
aggregate function.STR_TO_MAP
function (Spark semantics).TheSTRING_AGG
aggregate function.SUBSTR
function (BigQuery semantics).SUBSTR
function (MySQL semantics).SUBSTR
function (Oracle semantics).SUBSTR
function (PostgreSQL semantics).SUBSTRING_INDEX
function (Spark semantics).SUCCEEDS
operator for periods.TheSUM
aggregate function.TheSUM0
aggregate function.Reference to an input field, with a qualified name and an identifier.Table reference.TABLESAMPLE relational operator.TIME_ADD
function (BigQuery).TIME_SUB
function (BigQuery).Arithmetic multiplication operator, "*".TIMESTAMP_ADD
function (ODBC, SQL Server, MySQL).TIMESTAMP_DIFF
function (ODBC, SQL Server, MySQL).TIMESTAMP_SUB
function (BigQuery).TRANSLATE
function.TRIM
function.TRUNCATE TABLE
DDL statement.TheTUMBLE
group function.TheTUMBLE_END
auxiliary function of theTUMBLE
group function.TheTUMBLE_START
auxiliary function of theTUMBLE
group function.UNION
relational operator.UNIQUE
constraint.UNNEST
operator.UNPIVOT clause.UPDATE statement.V2M
(value-to-measure) internal operator.VALUES
relational operator.TheVAR_POP
aggregate function.TheVAR_SAMP
aggregate function.Window specification.WITH clause.Item in WITH clause.Represents a recursive CTE as a table ref.WITHIN DISTINCT
operator.WITHIN GROUP
operator. -
Field Summary
Modifier and TypeFieldDescriptionCategory consisting of all built-in aggregate functions.Category of SqlAvgAggFunction.Category of binary arithmetic.Category of binary comparison.Category of binary equality.Category of comparison operators.Category of SqlCovarAggFunction.Category consisting of all DDL operators.Category consisting of all DML operators.Category consisting of all expression operators.Category consisting of regular and special functions.final String
Lower-case name.Comparison operators that order values.Category consisting of query node types.Category consisting of set-query node types.Simple binary operators are those operators which expects operands from the same Domain.final String
Category of operators that do not depend on the argument order.Category of operators that do not depend on the argument order if argument types are equal.Category of all SQL statement types. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
belongsTo
(Collection<SqlKind> category) Returns whether thisSqlKind
belongs to a given category.If this kind represents a non-standard function, return OTHER_FUNCTION, otherwise return this.negate()
Returns the kind that you get if you apply NOT to this kind.Returns the kind that you get if you negate this kind.reverse()
Returns the kind that corresponds to this operator but in the opposite direction.static SqlKind
Returns the enum constant of this type with the specified name.static SqlKind[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
OTHER
Expression not covered by any otherSqlKind
value.- See Also:
-
SELECT
SELECT statement or sub-query. -
HINT
Sql Hint statement. -
TABLE_REF
Table reference. -
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
An identifier. -
LITERAL
A literal. -
INTERVAL_QUALIFIER
Interval qualifier. -
OTHER_FUNCTION
Function that is not a special function.- See Also:
-
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
CONVERT
function. -
TRANSLATE
TRANSLATE
function. -
POSITION
POSITION function. -
EXPLAIN
EXPLAIN statement. -
DESCRIBE_SCHEMA
DESCRIBE SCHEMA statement. -
DESCRIBE_TABLE
DESCRIBE TABLE statement. -
INSERT
INSERT statement. -
DELETE
DELETE statement. -
UPDATE
UPDATE statement. -
SET_OPTION
"ALTER scope SET option = value
" statement. -
DYNAMIC_PARAM
A dynamic parameter. -
GROUP_BY_DISTINCT
The DISTINCT keyword of the GROUP BY clause. -
ORDER_BY
ORDER BY clause.- See Also:
-
WITH
WITH clause. -
WITH_ITEM
Item in WITH clause. -
WITH_ITEM_TABLE_REF
Represents a recursive CTE as a table ref. -
ITEM
Item expression. -
UNION
UNION
relational operator. -
EXCEPT
EXCEPT
relational operator (known asMINUS
in some SQL dialects). -
INTERSECT
INTERSECT
relational operator. -
AS
AS
operator. -
MEASURE
MEASURE
operator. -
V2M
V2M
(value-to-measure) internal operator. -
M2V
M2V
(measure-to-value) internal operator. -
M2X
M2X
(evaluate measure in context) internal operator. -
AGG_M2M
AGG_M2M
(aggregate measure to measure) internal aggregate function. -
AGG_M2V
AGG_M2V
(aggregate measure to value) internal aggregate function. -
SAME_PARTITION
SAME_PARTITION
pseudo-function. -
ARGUMENT_ASSIGNMENT
Argument assignment operator,=>
. -
DEFAULT
DEFAULT
operator. -
OVER
OVER
operator. -
RESPECT_NULLS
RESPECT NULLS
operator. -
IGNORE_NULLS
IGNORE NULLS
operator. -
FILTER
FILTER
operator. -
WITHIN_GROUP
WITHIN GROUP
operator. -
WITHIN_DISTINCT
WITHIN DISTINCT
operator. -
WINDOW
Window specification. -
MERGE
MERGE statement. -
TABLESAMPLE
TABLESAMPLE relational operator. -
PIVOT
PIVOT clause. -
UNPIVOT
UNPIVOT clause. -
MATCH_RECOGNIZE
MATCH_RECOGNIZE clause. -
SNAPSHOT
SNAPSHOT operator. -
TIMES
Arithmetic multiplication operator, "*". -
DIVIDE
Arithmetic division operator, "/". -
MOD
Arithmetic remainder operator, "MOD" (and "%" in some dialects). -
PLUS
Arithmetic plus operator, "+".- See Also:
-
MINUS
Arithmetic minus operator, "-".- See Also:
-
PATTERN_ALTER
Alternation operator in a pattern expression within aMATCH_RECOGNIZE
clause. -
PATTERN_CONCAT
Concatenation operator in a pattern expression within aMATCH_RECOGNIZE
clause. -
IN
IN
operator. -
NOT_IN
NOT IN
operator.Only occurs in SqlNode trees. Is expanded to NOT(IN ...) before entering RelNode land.
-
DRUID_IN
Variant ofIN
for the Druid adapter. -
DRUID_NOT_IN
Variant ofNOT_IN
for the Druid adapter. -
LESS_THAN
Less-than operator, "<". -
GREATER_THAN
Greater-than operator, ">". -
LESS_THAN_OR_EQUAL
Less-than-or-equal operator, "<=". -
GREATER_THAN_OR_EQUAL
Greater-than-or-equal operator, ">=". -
EQUALS
Equals operator, "=". -
NOT_EQUALS
Not-equals operator, "!=" or "<>". The latter is standard, and preferred. -
IS_DISTINCT_FROM
IS DISTINCT FROM
operator. -
IS_NOT_DISTINCT_FROM
IS NOT DISTINCT FROM
operator. -
SEARCH
SEARCH
operator. (Analogous to scalarIN
, used only in RexNode, not SqlNode.) -
OR
Logical "OR" operator. -
AND
Logical "AND" operator. -
DOT
Dot. -
OVERLAPS
OVERLAPS
operator for periods. -
CONTAINS
CONTAINS
operator for periods. -
PRECEDES
PRECEDES
operator for periods. -
IMMEDIATELY_PRECEDES
IMMEDIATELY PRECEDES
operator for periods. -
SUCCEEDS
SUCCEEDS
operator for periods. -
IMMEDIATELY_SUCCEEDS
IMMEDIATELY SUCCEEDS
operator for periods. -
PERIOD_EQUALS
EQUALS
operator for periods. -
LIKE
LIKE
operator. -
RLIKE
RLIKE
operator. -
SIMILAR
SIMILAR
operator. -
POSIX_REGEX_CASE_SENSITIVE
~
operator (for POSIX-style regular expressions). -
POSIX_REGEX_CASE_INSENSITIVE
~*
operator (for case-insensitive POSIX-style regular expressions). -
BETWEEN
BETWEEN
operator. -
DRUID_BETWEEN
Variant ofBETWEEN
for the Druid adapter. -
CASE
CASE
expression. -
LAMBDA
LAMBDA
expression. -
INTERVAL
INTERVAL
expression. -
SEPARATOR
SEPARATOR
expression. -
NULLIF
NULLIF
operator. -
COALESCE
COALESCE
operator. -
DECODE
DECODE
function (Oracle). -
NVL
NVL
function (Oracle, Spark). -
NVL2
NVL2
function (Oracle, Spark). -
GREATEST
GREATEST
function (Oracle, Spark). -
GREATEST_PG
GREATEST
function (PostgreSQL). -
CONCAT2
The two-argumentCONCAT
function (Oracle). -
CONCAT_WITH_NULL
TheCONCAT
function (Postgresql and MSSQL) that ignores NULL. -
CONCAT_WS_MSSQL
TheCONCAT_WS
function (MSSQL). -
CONCAT_WS_POSTGRESQL
TheCONCAT_WS
function (Postgresql). -
CONCAT_WS_SPARK
TheCONCAT_WS
function (Spark). -
IF
The "IF" function (BigQuery, Hive, Spark). -
LEAST
LEAST
function (Oracle). -
LEAST_PG
LEAST
function (PostgreSQL). -
LOG
LOG
function. (Mysql, Spark). -
DATE_ADD
DATE_ADD
function (BigQuery Semantics). -
ADD_MONTHS
ADD_MONTHS
function (Oracle, Spark). -
DATE_TRUNC
DATE_TRUNC
function (BigQuery). -
DATE_SUB
DATE_SUB
function (BigQuery). -
TIME_ADD
TIME_ADD
function (BigQuery). -
TIME_SUB
TIME_SUB
function (BigQuery). -
TIMESTAMP_ADD
TIMESTAMP_ADD
function (ODBC, SQL Server, MySQL). -
TIMESTAMP_DIFF
TIMESTAMP_DIFF
function (ODBC, SQL Server, MySQL). -
TIMESTAMP_SUB
TIMESTAMP_SUB
function (BigQuery). -
NOT
LogicalNOT
operator. -
PLUS_PREFIX
Unary plus operator, as in "+1".- See Also:
-
MINUS_PREFIX
Unary minus operator, as in "-1".- See Also:
-
EXISTS
EXISTS
operator. -
SOME
SOME
quantification operator (also calledANY
). -
ALL
ALL
quantification operator. -
VALUES
VALUES
relational operator. -
EXPLICIT_TABLE
-
SCALAR_QUERY
Scalar query; that is, a sub-query used in an expression context, and returning one row and one column. -
PROCEDURE_CALL
Procedure call. -
NEW_SPECIFICATION
New specification. -
FINAL
FINAL
operator inMATCH_RECOGNIZE
. -
RUNNING
FINAL
operator inMATCH_RECOGNIZE
. -
PREV
PREV
operator inMATCH_RECOGNIZE
. -
NEXT
NEXT
operator inMATCH_RECOGNIZE
. -
FIRST
FIRST
operator inMATCH_RECOGNIZE
. -
LAST
LAST
operator inMATCH_RECOGNIZE
. -
CLASSIFIER
CLASSIFIER
operator inMATCH_RECOGNIZE
. -
MATCH_NUMBER
MATCH_NUMBER
operator inMATCH_RECOGNIZE
. -
SKIP_TO_FIRST
SKIP TO FIRST
qualifier of restarting point in aMATCH_RECOGNIZE
clause. -
SKIP_TO_LAST
SKIP TO LAST
qualifier of restarting point in aMATCH_RECOGNIZE
clause. -
DESCENDING
DESC
operator inORDER BY
. A parse tree, not a true expression. -
NULLS_FIRST
NULLS FIRST
clause inORDER BY
. A parse tree, not a true expression. -
NULLS_LAST
NULLS LAST
clause inORDER BY
. A parse tree, not a true expression. -
IS_TRUE
IS TRUE
operator. -
IS_FALSE
IS FALSE
operator. -
IS_NOT_TRUE
IS NOT TRUE
operator. -
IS_NOT_FALSE
IS NOT FALSE
operator. -
IS_UNKNOWN
IS UNKNOWN
operator. -
IS_NULL
IS NULL
operator. -
IS_NOT_NULL
IS NOT NULL
operator. -
PRECEDING
PRECEDING
qualifier of an interval end-point in a window specification. -
FOLLOWING
FOLLOWING
qualifier of an interval end-point in a window specification. -
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
Reference to an input field.(Only used at the RexNode level.)
-
TABLE_INPUT_REF
Reference to an input field, with a qualified name and an identifier.(Only used at the RexNode level.)
-
PATTERN_INPUT_REF
Reference to an input field, with pattern var as modifier.(Only used at the RexNode level.)
-
LOCAL_REF
Reference to a sub-expression computed within the current relational operator.(Only used at the RexNode level.)
-
LAMBDA_REF
Reference to lambda expression parameter.(Only used at the RexNode level.)
-
CORREL_VARIABLE
Reference to correlation variable.(Only used at the RexNode level.)
-
PATTERN_QUANTIFIER
the repetition quantifier of a pattern factor in a match_recognize clause. -
ROW
The row-constructor function. May be explicit or implicit:VALUES 1, ROW (2)
. -
COLUMN_LIST
The non-standard constructor used to pass a COLUMN_LIST parameter to a user-defined transform. -
CAST
The "CAST" operator, and also the PostgreSQL-style infix cast operator "::". -
SAFE_CAST
TheSAFE_CAST
function, which is similar toCAST
but returns NULL rather than throwing an error if the conversion fails. -
NEXT_VALUE
The "NEXT VALUE OF sequence" operator. -
CURRENT_VALUE
The "CURRENT VALUE OF sequence" operator. -
FLOOR
FLOOR
function. -
CEIL
CEIL
function. -
TRIM
TRIM
function. -
LTRIM
LTRIM
function (Oracle). -
RTRIM
RTRIM
function (Oracle). -
EXTRACT
EXTRACT
function. -
ARRAY_APPEND
ARRAY_APPEND
function (Spark semantics). -
ARRAY_COMPACT
ARRAY_COMPACT
function (Spark semantics). -
ARRAY_CONCAT
ARRAY_CONCAT
function (BigQuery semantics). -
ARRAY_CONTAINS
ARRAY_CONTAINS
function (Spark semantics). -
ARRAY_DISTINCT
ARRAY_DISTINCT
function (Spark semantics). -
ARRAY_EXCEPT
ARRAY_EXCEPT
function (Spark semantics). -
ARRAY_INSERT
ARRAY_INSERT
function (Spark semantics). -
ARRAY_INTERSECT
ARRAY_INTERSECT
function (Spark semantics). -
ARRAY_JOIN
ARRAY_JOIN
function (Spark semantics). -
ARRAY_LENGTH
ARRAY_LENGTH
function (Spark semantics). -
ARRAY_MAX
ARRAY_MAX
function (Spark semantics). -
ARRAY_MIN
ARRAY_MIN
function (Spark semantics). -
ARRAY_POSITION
ARRAY_POSITION
function (Spark semantics). -
ARRAY_PREPEND
ARRAY_PREPEND
function (Spark semantics). -
ARRAY_REMOVE
ARRAY_REMOVE
function (Spark semantics). -
ARRAY_REPEAT
ARRAY_REPEAT
function (Spark semantics). -
ARRAY_REVERSE
ARRAY_REVERSE
function (BigQuery semantics). -
ARRAY_SIZE
ARRAY_SIZE
function (Spark semantics). -
ARRAY_TO_STRING
ARRAY_TO_STRING
function (BigQuery semantics). -
ARRAY_UNION
ARRAY_UNION
function (Spark semantics). -
ARRAYS_OVERLAP
ARRAYS_OVERLAP
function (Spark semantics). -
ARRAYS_ZIP
ARRAYS_ZIP
function (Spark semantics). -
SORT_ARRAY
SORT_ARRAY
function (Spark semantics). -
MAP_CONCAT
MAP_CONCAT
function (Spark semantics). -
MAP_ENTRIES
MAP_ENTRIES
function (Spark semantics). -
MAP_KEYS
MAP_KEYS
function (Spark semantics). -
MAP_VALUES
MAP_VALUES
function (Spark semantics). -
MAP_CONTAINS_KEY
MAP_CONTAINS_KEY
function (Spark semantics). -
MAP_FROM_ARRAYS
MAP_FROM_ARRAYS
function (Spark semantics). -
MAP_FROM_ENTRIES
MAP_FROM_ENTRIES
function (Spark semantics). -
STR_TO_MAP
STR_TO_MAP
function (Spark semantics). -
SUBSTRING_INDEX
SUBSTRING_INDEX
function (Spark semantics). -
REVERSE
REVERSE
function (SQL Server, MySQL). -
REVERSE_SPARK
REVERSE
function (Spark semantics). -
SOUNDEX_SPARK
SOUNDEX
function (Spark semantics). -
SUBSTR_BIG_QUERY
SUBSTR
function (BigQuery semantics). -
SUBSTR_MYSQL
SUBSTR
function (MySQL semantics). -
SUBSTR_ORACLE
SUBSTR
function (Oracle semantics). -
SUBSTR_POSTGRESQL
SUBSTR
function (PostgreSQL semantics). -
CHAR_LENGTH
CHAR_LENGTH
function. -
ENDS_WITH
ENDS_WITH
function. -
STARTS_WITH
STARTS_WITH
function. -
JDBC_FN
Call to a function using JDBC function syntax. -
MULTISET_VALUE_CONSTRUCTOR
MULTISET
value constructor. -
MULTISET_QUERY_CONSTRUCTOR
MULTISET
query constructor. -
JSON_VALUE_EXPRESSION
JSON
value expression. -
JSON_ARRAYAGG
JSON_ARRAYAGG
aggregate function. -
JSON_OBJECTAGG
JSON_OBJECTAGG
aggregate function. -
JSON_TYPE
JSON
type function. -
UNNEST
UNNEST
operator. -
LATERAL
The "LATERAL" qualifier to relations in the FROM clause. -
COLLECTION_TABLE
Table operator which converts user-defined transform into a relation, for example,select * from TABLE(udx(x, y, z))
. See also theEXPLICIT_TABLE
prefix operator. -
ARRAY_VALUE_CONSTRUCTOR
Array Value Constructor, e.g.Array[1, 2, 3]
. -
ARRAY_QUERY_CONSTRUCTOR
Array Query Constructor, e.g.Array(select deptno from dept)
. -
MAP_VALUE_CONSTRUCTOR
MAP value constructor, e.g.MAP ['washington', 1, 'obama', 44]
. -
MAP_QUERY_CONSTRUCTOR
MAP query constructor, e.g.MAP (SELECT empno, deptno FROM emp)
. -
CURSOR
CURSOR
constructor, for example,SELECT * FROM TABLE(udx(CURSOR(SELECT ...), x, y, z))
. -
CONTAINS_SUBSTR
CONTAINS_SUBSTR
function (BigQuery semantics). -
LITERAL_AGG
TheLITERAL_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
Literal chain operator (for composite string literals). An internal operator that does not appear in SQL syntax. -
ESCAPE
Escape operator (always part of LIKE or SIMILAR TO expression). An internal operator that does not appear in SQL syntax. -
REINTERPRET
The internal REINTERPRET operator (meaning a reinterpret cast). An internal operator that does not appear in SQL syntax. -
EXTEND
The internalEXTEND
operator that qualifies a table name in theFROM
clause. -
CUBE
The internalCUBE
operator that occurs within aGROUP BY
clause. -
ROLLUP
The internalROLLUP
operator that occurs within aGROUP BY
clause. -
GROUPING_SETS
The internalGROUPING SETS
operator that occurs within aGROUP BY
clause. -
GROUPING
TheGROUPING(e, ...)
function. -
GROUPING_ID
Deprecated.UseGROUPING
. -
GROUP_ID
TheGROUP_ID()
function. -
PATTERN_PERMUTE
The internal "permute" function in a MATCH_RECOGNIZE clause. -
PATTERN_EXCLUDED
The special patterns to exclude enclosing pattern from output in a MATCH_RECOGNIZE clause. -
COUNT
TheCOUNT
aggregate function. -
SUM
TheSUM
aggregate function. -
SUM0
TheSUM0
aggregate function. -
MIN
TheMIN
aggregate function. -
MAX
TheMAX
aggregate function. -
LEAD
TheLEAD
aggregate function. -
LAG
TheLAG
aggregate function. -
FIRST_VALUE
TheFIRST_VALUE
aggregate function. -
LAST_VALUE
TheLAST_VALUE
aggregate function. -
ANY_VALUE
TheANY_VALUE
aggregate function. -
COVAR_POP
TheCOVAR_POP
aggregate function. -
COVAR_SAMP
TheCOVAR_SAMP
aggregate function. -
REGR_COUNT
TheREGR_COUNT
aggregate function. -
REGR_SXX
TheREGR_SXX
aggregate function. -
REGR_SYY
TheREGR_SYY
aggregate function. -
AVG
TheAVG
aggregate function. -
STDDEV_POP
TheSTDDEV_POP
aggregate function. -
STDDEV_SAMP
TheSTDDEV_SAMP
aggregate function. -
VAR_POP
TheVAR_POP
aggregate function. -
VAR_SAMP
TheVAR_SAMP
aggregate function. -
NTILE
TheNTILE
aggregate function. -
NTH_VALUE
TheNTH_VALUE
aggregate function. -
LISTAGG
TheLISTAGG
aggregate function. -
STRING_AGG
TheSTRING_AGG
aggregate function. -
COUNTIF
TheCOUNTIF
aggregate function. -
ARRAY_AGG
TheARRAY_AGG
aggregate function. -
ARRAY_CONCAT_AGG
TheARRAY_CONCAT_AGG
aggregate function. -
GROUP_CONCAT
TheGROUP_CONCAT
aggregate function. -
COLLECT
TheCOLLECT
aggregate function. -
MODE
TheMODE
aggregate function. -
ARG_MAX
TheARG_MAX
aggregate function. -
ARG_MIN
TheARG_MIN
aggregate function. -
PERCENTILE_CONT
ThePERCENTILE_CONT
aggregate function. -
PERCENTILE_DISC
ThePERCENTILE_DISC
aggregate function. -
FUSION
TheFUSION
aggregate function. -
INTERSECTION
TheINTERSECTION
aggregate function. -
SINGLE_VALUE
TheSINGLE_VALUE
aggregate function. -
AGGREGATE_FN
TheAGGREGATE
aggregate function. -
BITAND
TheBITAND
scalar function. -
BITOR
TheBITOR
scalar function. -
BITXOR
TheBITXOR
scalar function. -
BITNOT
TheBITNOT
scalar function. -
BIT_AND
TheBIT_AND
aggregate function. -
BIT_OR
TheBIT_OR
aggregate function. -
BIT_XOR
TheBIT_XOR
aggregate function. -
ROW_NUMBER
TheROW_NUMBER
window function. -
RANK
TheRANK
window function. -
PERCENT_RANK
ThePERCENT_RANK
window function. -
DENSE_RANK
TheDENSE_RANK
window function. -
CUME_DIST
TheROW_NUMBER
window function. -
DESCRIPTOR
TheDESCRIPTOR(column_name, ...)
. -
TUMBLE
TheTUMBLE
group function. -
TUMBLE_START
TheTUMBLE_START
auxiliary function of theTUMBLE
group function. -
TUMBLE_END
TheTUMBLE_END
auxiliary function of theTUMBLE
group function. -
HOP
TheHOP
group function. -
HOP_START
TheHOP_START
auxiliary function of theHOP
group function. -
HOP_END
TheHOP_END
auxiliary function of theHOP
group function. -
SESSION
TheSESSION
group function. -
SESSION_START
TheSESSION_START
auxiliary function of theSESSION
group function. -
SESSION_END
TheSESSION_END
auxiliary function of theSESSION
group function. -
COLUMN_DECL
Column declaration. -
ATTRIBUTE_DEF
Attribute definition. -
CHECK
CHECK
constraint. -
UNIQUE
UNIQUE
constraint. -
PRIMARY_KEY
PRIMARY KEY
constraint. -
FOREIGN_KEY
FOREIGN KEY
constraint. -
ST_DWITHIN
TheST_DWithin
geo-spatial function. -
ST_POINT
TheST_Point
function. -
ST_POINT3
TheST_Point
function that makes a 3D point. -
ST_MAKE_LINE
TheST_MakeLine
function that makes a line. -
ST_CONTAINS
TheST_Contains
function that tests whether one geometry contains another. -
HILBERT
TheHilbert
function that converts (x, y) to a position on a Hilbert space-filling curve. -
COMMIT
COMMIT
session control statement. -
ROLLBACK
ROLLBACK
session control statement. -
ALTER_SESSION
ALTER SESSION
DDL statement. -
CREATE_SCHEMA
CREATE SCHEMA
DDL statement. -
CREATE_FOREIGN_SCHEMA
CREATE FOREIGN SCHEMA
DDL statement. -
DROP_SCHEMA
DROP SCHEMA
DDL statement. -
CREATE_TABLE
CREATE TABLE
DDL statement. -
CREATE_TABLE_LIKE
CREATE TABLE LIKE
DDL statement. -
ALTER_TABLE
ALTER TABLE
DDL statement. -
DROP_TABLE
DROP TABLE
DDL statement. -
TRUNCATE_TABLE
TRUNCATE TABLE
DDL statement. -
CREATE_VIEW
CREATE VIEW
DDL statement. -
ALTER_VIEW
ALTER VIEW
DDL statement. -
DROP_VIEW
DROP VIEW
DDL statement. -
CREATE_MATERIALIZED_VIEW
CREATE MATERIALIZED VIEW
DDL statement. -
ALTER_MATERIALIZED_VIEW
ALTER MATERIALIZED VIEW
DDL statement. -
DROP_MATERIALIZED_VIEW
DROP MATERIALIZED VIEW
DDL statement. -
CREATE_SEQUENCE
CREATE SEQUENCE
DDL statement. -
ALTER_SEQUENCE
ALTER SEQUENCE
DDL statement. -
DROP_SEQUENCE
DROP SEQUENCE
DDL statement. -
CREATE_INDEX
CREATE INDEX
DDL statement. -
ALTER_INDEX
ALTER INDEX
DDL statement. -
DROP_INDEX
DROP INDEX
DDL statement. -
CREATE_TYPE
CREATE TYPE
DDL statement. -
DROP_TYPE
DROP TYPE
DDL statement. -
CREATE_FUNCTION
CREATE FUNCTION
DDL statement. -
DROP_FUNCTION
DROP FUNCTION
DDL statement. -
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
-
SET_QUERY
-
AGGREGATE
Category consisting of all built-in aggregate functions. -
DML
Category consisting of all DML operators.Consists of:
INSERT
,UPDATE
,DELETE
,MERGE
,PROCEDURE_CALL
.NOTE jvs 1-June-2006: For now we treat procedure calls as DML; this makes it easy for JDBC clients to call execute or executeUpdate and not have to process dummy cursor results. If in the future we support procedures which return results sets, we'll need to refine this.
-
DDL
Category consisting of all DDL operators. -
QUERY
-
EXPRESSION
Category consisting of all expression operators.A node is an expression if it is NOT one of the following:
AS
,ARGUMENT_ASSIGNMENT
,DEFAULT
,DESCENDING
,SELECT
,JOIN
,OTHER_FUNCTION
,CAST
,CONVERT
,TRIM
,LITERAL_CHAIN
,JDBC_FN
,PRECEDING
,FOLLOWING
,ORDER_BY
,COLLECTION_TABLE
,TABLESAMPLE
,UNNEST
or an aggregate function, DML or DDL. -
TOP_LEVEL
-
FUNCTION
-
AVG_AGG_FUNCTIONS
Category of SqlAvgAggFunction.Consists of
AVG
,STDDEV_POP
,STDDEV_SAMP
,VAR_POP
,VAR_SAMP
. -
COVAR_AVG_AGG_FUNCTIONS
Category of SqlCovarAggFunction.Consists of
COVAR_POP
,COVAR_SAMP
,REGR_SXX
,REGR_SYY
. -
COMPARISON
Category of comparison operators.Consists of:
IN
,NOT_IN
,EQUALS
,NOT_EQUALS
,LESS_THAN
,GREATER_THAN
,LESS_THAN_OR_EQUAL
,GREATER_THAN_OR_EQUAL
. -
ORDER_COMPARISON
Comparison operators that order values.Consists of:
LESS_THAN
,GREATER_THAN
,LESS_THAN_OR_EQUAL
,GREATER_THAN_OR_EQUAL
. -
BINARY_ARITHMETIC
-
BINARY_EQUALITY
Category of binary equality.Consists of:
EQUALS
NOT_EQUALS
-
BINARY_COMPARISON
Category of binary comparison.Consists of:
EQUALS
NOT_EQUALS
GREATER_THAN
GREATER_THAN_OR_EQUAL
LESS_THAN
LESS_THAN_OR_EQUAL
IS_DISTINCT_FROM
IS_NOT_DISTINCT_FROM
-
SYMMETRICAL
-
SYMMETRICAL_SAME_ARG_TYPE
-
SIMPLE_BINARY_OPS
Simple binary operators are those operators which expects operands from the same Domain.Example: simple comparisons (
=
,<
).Note: it does not contain
IN
because that is defined on D x D^n. -
lowerName
Lower-case name. -
sql
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
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()
returnsLESS_THAN
. -
negate
Returns the kind that you get if you apply NOT to this kind.For example,
IS_NOT_NULL.negate()
returnsIS_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
, whileIS_FALSE(null)
=false
, soNOT(IS_TRUE(X))
should beIS_NOT_TRUE(X)
. On the other hand,IS_TRUE(NOT(null))
=IS_TRUE(null)
=false
.This is why negate() != negateNullSafe() for these operators.
-
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
andIS_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
Returns whether thisSqlKind
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
If this kind represents a non-standard function, return OTHER_FUNCTION, otherwise return this. Do not add standard functions here.
-
GROUPING
.