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()) {
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.)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionADD_MONTHSfunction (Oracle, Spark).AGG_M2M(aggregate measure to measure) internal aggregate function.AGG_M2V(aggregate measure to value) internal aggregate function.TheAGGREGATEaggregate function.ALLquantification operator.ALTER INDEXDDL statement.ALTER MATERIALIZED VIEWDDL statement.ALTER SEQUENCEDDL statement.ALTER SESSIONDDL statement.ALTER TABLEDDL statement.ALTER VIEWDDL statement.Logical "AND" operator.TheANY_VALUEaggregate function.TheARG_MAXaggregate function.TheARG_MINaggregate function.Argument assignment operator,=>.TheARRAY_AGGaggregate function.ARRAY_APPENDfunction (Spark semantics).ARRAY_COMPACTfunction (Spark semantics).ARRAY_CONCATfunction (BigQuery semantics).TheARRAY_CONCAT_AGGaggregate function.ARRAY_CONTAINSfunction (Spark semantics).ARRAY_DISTINCTfunction (Spark semantics).ARRAY_EXCEPTfunction (Spark semantics).ARRAY_INSERTfunction (Spark semantics).ARRAY_INTERSECTfunction (Spark semantics).ARRAY_JOINfunction (Spark semantics).ARRAY_LENGTHfunction (Spark semantics).ARRAY_MAXfunction (Spark semantics).ARRAY_MINfunction (Spark semantics).ARRAY_POSITIONfunction (Spark semantics).ARRAY_PREPENDfunction (Spark semantics).Array Query Constructor, e.g.ARRAY_REMOVEfunction (Spark semantics).ARRAY_REPEATfunction (Spark semantics).ARRAY_REVERSEfunction (BigQuery semantics).ARRAY_SIZEfunction (Spark semantics).ARRAY_SLICEfunction (Hive semantics).ARRAY_TO_STRINGfunction (BigQuery semantics).ARRAY_UNIONfunction (Spark semantics).Array Value Constructor, e.g.ARRAYS_OVERLAPfunction (Spark semantics).ARRAYS_ZIPfunction (Spark semantics).ASoperator.Attribute definition.TheAVGaggregate function.BETWEENoperator.TheBIT_ANDaggregate function.TheBIT_ORaggregate function.TheBIT_XORaggregate function.TheBITANDscalar function.TheBITNOTscalar function.TheBITORscalar function.TheBITXORscalar function.CASEexpression.The "CAST" operator, and also the PostgreSQL-style infix cast operator "::".CEILfunction.CHAR_LENGTHfunction.CHECKconstraint.Checked version of DIVIDE, which produces a runtime error on overflow.Checked version of MINUS, which produces a runtime error on overflow.Checked version of unary minus operator.Checked version of PLUS, which produces a runtime error on overflow.Checked version of TIMES, which produces a runtime error on overflow.CLASSIFIERoperator inMATCH_RECOGNIZE.COALESCEoperator.TheCOLLECTaggregate 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.COMMITsession control statement.TheCONCATfunction (Postgresql and MSSQL) that ignores NULL.TheCONCAT_WSfunction (MSSQL).TheCONCAT_WSfunction (Postgresql).TheCONCAT_WSfunction (Spark).The two-argumentCONCATfunction (Oracle).CONTAINSoperator for periods.CONTAINS_SUBSTRfunction (BigQuery semantics).CONVERTfunction.Oracle'sCONVERTfunction.Reference to correlation variable.TheCOUNTaggregate function.TheCOUNTIFaggregate function.TheCOVAR_POPaggregate function.TheCOVAR_SAMPaggregate function.CREATE FOREIGN SCHEMADDL statement.CREATE FUNCTIONDDL statement.CREATE INDEXDDL statement.CREATE MATERIALIZED VIEWDDL statement.CREATE SCHEMADDL statement.CREATE SEQUENCEDDL statement.CREATE TABLEDDL statement.CREATE TABLE LIKEDDL statement.CREATE TYPEDDL statement.CREATE VIEWDDL statement.The internalCUBEoperator that occurs within aGROUP BYclause.TheROW_NUMBERwindow function.The "CURRENT VALUE OF sequence" operator.CURSORconstructor, for example,SELECT * FROM TABLE(udx(CURSOR(SELECT ...), x, y, z)).DATE_ADDfunction (BigQuery Semantics).DATE_SUBfunction (BigQuery).DATE_TRUNCfunction (BigQuery).DECODEfunction (Oracle).DEFAULToperator.DELETE statement.TheDENSE_RANKwindow function.DESCoperator inORDER BY.DESCRIBE SCHEMA statement.DESCRIBE TABLE statement.TheDESCRIPTOR(column_name, ...).Arithmetic division operator, "/".Dot.DROP FUNCTIONDDL statement.DROP INDEXDDL statement.DROP MATERIALIZED VIEWDDL statement.DROP SCHEMADDL statement.DROP SEQUENCEDDL statement.DROP TABLEDDL statement.DROP TYPEDDL statement.DROP VIEWDDL statement.Variant ofBETWEENfor the Druid adapter.Variant ofINfor the Druid adapter.Variant ofNOT_INfor the Druid adapter.A dynamic parameter.ENDS_WITHfunction.Equals operator, "=".Escape operator (always part of LIKE or SIMILAR TO expression).EXCEPTrelational operator (known asMINUSin some SQL dialects).EXISTSoperator.EXPLAIN statement.Explicit table, e.g.The internalEXTENDoperator that qualifies a table name in theFROMclause.EXTRACTfunction.The field access operator, ".".FILTERoperator.FINALoperator inMATCH_RECOGNIZE.FIRSToperator inMATCH_RECOGNIZE.TheFIRST_VALUEaggregate function.FLOORfunction.FOLLOWINGqualifier of an interval end-point in a window specification.FOREIGN KEYconstraint.TheFUSIONaggregate function.Greater-than operator, ">".Greater-than-or-equal operator, ">=".GREATESTfunction (Oracle).GREATESTfunction (PostgreSQL, Spark).The DISTINCT keyword of the GROUP BY clause.TheGROUP_CONCATaggregate function.TheGROUP_ID()function.TheGROUPING(e, ...)function.Deprecated.The internalGROUPING SETSoperator that occurs within aGROUP BYclause.TheHilbertfunction that converts (x, y) to a position on a Hilbert space-filling curve.Sql Hint statement.TheHOPgroup function.TheHOP_ENDauxiliary function of theHOPgroup function.TheHOP_STARTauxiliary function of theHOPgroup function.An identifier.The "IF" function (BigQuery, Hive, Spark).IGNORE NULLSoperator.IMMEDIATELY PRECEDESoperator for periods.IMMEDIATELY SUCCEEDSoperator for periods.INoperator.Reference to an input field.INSERT statement.INTERSECTrelational operator.TheINTERSECTIONaggregate function.INTERVALexpression.Interval qualifier.IS DISTINCT FROMoperator.IS FALSEoperator.IS NOT DISTINCT FROMoperator.IS NOT FALSEoperator.IS NOT NULLoperator.IS NOT TRUEoperator.IS NULLoperator.IS TRUEoperator.IS UNKNOWNoperator.Item expression.Call to a function using JDBC function syntax.JOIN operator or compound FROM clause.JSON_ARRAYAGGaggregate function.JSON_OBJECTAGGaggregate function.JSONtype function.JSONvalue expression.TheLAGaggregate function.LAMBDAexpression.Reference to lambda expression parameter.LASToperator inMATCH_RECOGNIZE.TheLAST_VALUEaggregate function.The "LATERAL" qualifier to relations in the FROM clause.TheLEADaggregate function.LEASTfunction (Oracle).LEASTfunction (PostgreSQL, Spark).Less-than operator, "<".Less-than-or-equal operator, "<=".LIKEoperator.TheLISTAGGaggregate function.A literal.TheLITERAL_AGGaggregate 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.LOGfunction.LTRIMfunction (Oracle).M2V(measure-to-value) internal operator.M2X(evaluate measure in context) internal operator.MAP_CONCATfunction (Spark semantics).MAP_CONTAINS_KEYfunction (Spark semantics).MAP_ENTRIESfunction (Spark semantics).MAP_FROM_ARRAYSfunction (Spark semantics).MAP_FROM_ENTRIESfunction (Spark semantics).MAP_KEYSfunction (Spark semantics).MAP query constructor, e.g.MAP value constructor, e.g.MAP_VALUESfunction (Spark semantics).MATCH_NUMBERoperator inMATCH_RECOGNIZE.MATCH_RECOGNIZE clause.TheMAXaggregate function.MEASUREoperator.MERGE statement.TheMINaggregate function.Arithmetic minus operator, "-".Unary minus operator, as in "-1".Arithmetic remainder operator, "MOD" (and "%" in some dialects).TheMODEaggregate function.MULTISETquery constructor.MULTISETvalue constructor.New specification.NEXToperator inMATCH_RECOGNIZE.The "NEXT VALUE OF sequence" operator.LogicalNOToperator.Not-equals operator, "!=" or "<>".NOT INoperator.TheNTH_VALUEaggregate function.TheNTILEaggregate function.NULLIFoperator.NULLS FIRSTclause inORDER BY.NULLS LASTclause inORDER BY.NVLfunction (Oracle, Spark).NVL2function (Oracle, Spark).Logical "OR" operator.ORDER BY clause.Expression not covered by any otherSqlKindvalue.DDL statement not handled above.Function that is not a special function.OVERoperator.OVERLAPSoperator for periods.Alternation operator in a pattern expression within aMATCH_RECOGNIZEclause.Concatenation operator in a pattern expression within aMATCH_RECOGNIZEclause.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_RANKwindow function.ThePERCENTILE_CONTaggregate function.ThePERCENTILE_DISCaggregate function.EQUALSoperator 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).PRECEDESoperator for periods.PRECEDINGqualifier of an interval end-point in a window specification.PREVoperator inMATCH_RECOGNIZE.PRIMARY KEYconstraint.Procedure call.TheRANKwindow function.TheREGR_COUNTaggregate function.TheREGR_SXXaggregate function.TheREGR_SYYaggregate function.The internal REINTERPRET operator (meaning a reinterpret cast).RESPECT NULLSoperator.REVERSEfunction (SQL Server, MySQL).REVERSEfunction (Spark semantics).RLIKEoperator.ROLLBACKsession control statement.The internalROLLUPoperator that occurs within aGROUP BYclause.The row-constructor function.TheROW_NUMBERwindow function.RTRIMfunction (Oracle).FINALoperator inMATCH_RECOGNIZE.TheSAFE_CASTfunction, which is similar toCASTbut returns NULL rather than throwing an error if the conversion fails.SAME_PARTITIONpseudo-function.Scalar query; that is, a sub-query used in an expression context, and returning one row and one column.SEARCHoperator.SELECT statement or sub-query.SEPARATORexpression.TheSESSIONgroup function.TheSESSION_ENDauxiliary function of theSESSIONgroup function.TheSESSION_STARTauxiliary function of theSESSIONgroup function."ALTER scope SET option = value" statement.Input tables have either row semantics or set semantics.SIMILARoperator.TheSINGLE_VALUEaggregate function.SKIP TO FIRSTqualifier of restarting point in aMATCH_RECOGNIZEclause.SKIP TO LASTqualifier of restarting point in aMATCH_RECOGNIZEclause.SNAPSHOT operator.SOMEquantification operator (also calledANY).SORT_ARRAYfunction (Spark semantics).SOUNDEXfunction (Spark semantics).TheST_Containsfunction that tests whether one geometry contains another.TheST_DWithingeo-spatial function.TheST_MakeLinefunction that makes a line.TheST_Pointfunction.TheST_Pointfunction that makes a 3D point.STARTS_WITHfunction.TheSTDDEV_POPaggregate function.TheSTDDEV_SAMPaggregate function.STR_TO_MAPfunction (Spark semantics).TheSTRING_AGGaggregate function.STRING_TO_ARRAYfunction (PostgreSQL semantics).SUBSTRfunction (BigQuery semantics).SUBSTRfunction (MySQL semantics).SUBSTRfunction (Oracle semantics).SUBSTRfunction (PostgreSQL semantics).SUBSTRING_INDEXfunction (Spark semantics).SUCCEEDSoperator for periods.TheSUMaggregate function.TheSUM0aggregate function.Reference to an input field, with a qualified name and an identifier.Table reference.TABLESAMPLE relational operator.TIME_ADDfunction (BigQuery).TIME_SUBfunction (BigQuery).Arithmetic multiplication operator, "*".TIMESTAMP_ADDfunction (ODBC, SQL Server, MySQL).TIMESTAMP_DIFFfunction (ODBC, SQL Server, MySQL).TIMESTAMP_SUBfunction (BigQuery).TRANSLATEfunction.TRIMfunction.TRUNCATE TABLEDDL statement.TheTUMBLEgroup function.TheTUMBLE_ENDauxiliary function of theTUMBLEgroup function.TheTUMBLE_STARTauxiliary function of theTUMBLEgroup function.UNIONrelational operator.UNIQUEconstraint.UNNESToperator.UNPIVOT clause.UPDATE statement.V2M(value-to-measure) internal operator.VALUESrelational operator.TheVAR_POPaggregate function.TheVAR_SAMPaggregate function.Window specification.WITH clause.Item in WITH clause.Represents a recursive CTE as a table ref.WITHIN DISTINCToperator.WITHIN GROUPoperator. -
Field Summary
FieldsModifier 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 StringLower-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 StringCategory 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 booleanbelongsTo(Collection<SqlKind> category) Returns whether thisSqlKindbelongs 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 SqlKindReturns 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 otherSqlKindvalue.- 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
CONVERTfunction. -
CONVERT_ORACLE
Oracle'sCONVERTfunction. -
TRANSLATE
TRANSLATEfunction. -
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
UNIONrelational operator. -
EXCEPT
EXCEPTrelational operator (known asMINUSin some SQL dialects). -
INTERSECT
INTERSECTrelational operator. -
AS
ASoperator. -
MEASURE
MEASUREoperator. -
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_PARTITIONpseudo-function. -
ARGUMENT_ASSIGNMENT
Argument assignment operator,=>. -
DEFAULT
DEFAULToperator. -
OVER
OVERoperator. -
RESPECT_NULLS
RESPECT NULLSoperator. -
IGNORE_NULLS
IGNORE NULLSoperator. -
FILTER
FILTERoperator. -
WITHIN_GROUP
WITHIN GROUPoperator. -
WITHIN_DISTINCT
WITHIN DISTINCToperator. -
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:
-
CHECKED_PLUS
Checked version of PLUS, which produces a runtime error on overflow. Not used for date/time arithmetic. -
CHECKED_MINUS
Checked version of MINUS, which produces a runtime error on overflow. Not used for date/time arithmetic. -
CHECKED_TIMES
Checked version of TIMES, which produces a runtime error on overflow. Not used for date/time arithmetic. -
CHECKED_DIVIDE
Checked version of DIVIDE, which produces a runtime error on overflow. For example, INT_MIN / -1. Not used for date/time arithmetic. -
PATTERN_ALTER
Alternation operator in a pattern expression within aMATCH_RECOGNIZEclause. -
PATTERN_CONCAT
Concatenation operator in a pattern expression within aMATCH_RECOGNIZEclause. -
IN
INoperator. -
NOT_IN
NOT INoperator.Only occurs in SqlNode trees. Is expanded to NOT(IN ...) before entering RelNode land.
-
DRUID_IN
Variant ofINfor the Druid adapter. -
DRUID_NOT_IN
Variant ofNOT_INfor 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 FROMoperator. -
IS_NOT_DISTINCT_FROM
IS NOT DISTINCT FROMoperator. -
SEARCH
SEARCHoperator. (Analogous to scalarIN, used only in RexNode, not SqlNode.) -
OR
Logical "OR" operator. -
AND
Logical "AND" operator. -
DOT
Dot. -
OVERLAPS
OVERLAPSoperator for periods. -
CONTAINS
CONTAINSoperator for periods. -
PRECEDES
PRECEDESoperator for periods. -
IMMEDIATELY_PRECEDES
IMMEDIATELY PRECEDESoperator for periods. -
SUCCEEDS
SUCCEEDSoperator for periods. -
IMMEDIATELY_SUCCEEDS
IMMEDIATELY SUCCEEDSoperator for periods. -
PERIOD_EQUALS
EQUALSoperator for periods. -
LIKE
LIKEoperator. -
RLIKE
RLIKEoperator. -
SIMILAR
SIMILARoperator. -
POSIX_REGEX_CASE_SENSITIVE
~operator (for POSIX-style regular expressions). -
POSIX_REGEX_CASE_INSENSITIVE
~*operator (for case-insensitive POSIX-style regular expressions). -
BETWEEN
BETWEENoperator. -
DRUID_BETWEEN
Variant ofBETWEENfor the Druid adapter. -
CASE
CASEexpression. -
LAMBDA
LAMBDAexpression. -
INTERVAL
INTERVALexpression. -
SEPARATOR
SEPARATORexpression. -
NULLIF
NULLIFoperator. -
COALESCE
COALESCEoperator. -
DECODE
DECODEfunction (Oracle). -
NVL
NVLfunction (Oracle, Spark). -
NVL2
NVL2function (Oracle, Spark). -
GREATEST
GREATESTfunction (Oracle). -
GREATEST_PG
GREATESTfunction (PostgreSQL, Spark). -
CONCAT2
The two-argumentCONCATfunction (Oracle). -
CONCAT_WITH_NULL
TheCONCATfunction (Postgresql and MSSQL) that ignores NULL. -
CONCAT_WS_MSSQL
TheCONCAT_WSfunction (MSSQL). -
CONCAT_WS_POSTGRESQL
TheCONCAT_WSfunction (Postgresql). -
CONCAT_WS_SPARK
TheCONCAT_WSfunction (Spark). -
IF
The "IF" function (BigQuery, Hive, Spark). -
LEAST
LEASTfunction (Oracle). -
LEAST_PG
LEASTfunction (PostgreSQL, Spark). -
LOG
LOGfunction. (Mysql, Spark). -
DATE_ADD
DATE_ADDfunction (BigQuery Semantics). -
ADD_MONTHS
ADD_MONTHSfunction (Oracle, Spark). -
DATE_TRUNC
DATE_TRUNCfunction (BigQuery). -
DATE_SUB
DATE_SUBfunction (BigQuery). -
TIME_ADD
TIME_ADDfunction (BigQuery). -
TIME_SUB
TIME_SUBfunction (BigQuery). -
TIMESTAMP_ADD
TIMESTAMP_ADDfunction (ODBC, SQL Server, MySQL). -
TIMESTAMP_DIFF
TIMESTAMP_DIFFfunction (ODBC, SQL Server, MySQL). -
TIMESTAMP_SUB
TIMESTAMP_SUBfunction (BigQuery). -
NOT
LogicalNOToperator. -
PLUS_PREFIX
Unary plus operator, as in "+1".- See Also:
-
MINUS_PREFIX
Unary minus operator, as in "-1".- See Also:
-
CHECKED_MINUS_PREFIX
Checked version of unary minus operator. -
EXISTS
EXISTSoperator. -
SOME
SOMEquantification operator (also calledANY). -
ALL
ALLquantification operator. -
VALUES
VALUESrelational 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
FINALoperator inMATCH_RECOGNIZE. -
RUNNING
FINALoperator inMATCH_RECOGNIZE. -
PREV
PREVoperator inMATCH_RECOGNIZE. -
NEXT
NEXToperator inMATCH_RECOGNIZE. -
FIRST
FIRSToperator inMATCH_RECOGNIZE. -
LAST
LASToperator inMATCH_RECOGNIZE. -
CLASSIFIER
CLASSIFIERoperator inMATCH_RECOGNIZE. -
MATCH_NUMBER
MATCH_NUMBERoperator inMATCH_RECOGNIZE. -
SKIP_TO_FIRST
SKIP TO FIRSTqualifier of restarting point in aMATCH_RECOGNIZEclause. -
SKIP_TO_LAST
SKIP TO LASTqualifier of restarting point in aMATCH_RECOGNIZEclause. -
DESCENDING
DESCoperator inORDER BY. A parse tree, not a true expression. -
NULLS_FIRST
NULLS FIRSTclause inORDER BY. A parse tree, not a true expression. -
NULLS_LAST
NULLS LASTclause inORDER BY. A parse tree, not a true expression. -
IS_TRUE
IS TRUEoperator. -
IS_FALSE
IS FALSEoperator. -
IS_NOT_TRUE
IS NOT TRUEoperator. -
IS_NOT_FALSE
IS NOT FALSEoperator. -
IS_UNKNOWN
IS UNKNOWNoperator. -
IS_NULL
IS NULLoperator. -
IS_NOT_NULL
IS NOT NULLoperator. -
PRECEDING
PRECEDINGqualifier of an interval end-point in a window specification. -
FOLLOWING
FOLLOWINGqualifier 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_CASTfunction, which is similar toCASTbut 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
FLOORfunction. -
CEIL
CEILfunction. -
TRIM
TRIMfunction. -
LTRIM
LTRIMfunction (Oracle). -
RTRIM
RTRIMfunction (Oracle). -
EXTRACT
EXTRACTfunction. -
ARRAY_APPEND
ARRAY_APPENDfunction (Spark semantics). -
ARRAY_COMPACT
ARRAY_COMPACTfunction (Spark semantics). -
ARRAY_CONCAT
ARRAY_CONCATfunction (BigQuery semantics). -
ARRAY_CONTAINS
ARRAY_CONTAINSfunction (Spark semantics). -
ARRAY_DISTINCT
ARRAY_DISTINCTfunction (Spark semantics). -
ARRAY_EXCEPT
ARRAY_EXCEPTfunction (Spark semantics). -
ARRAY_INSERT
ARRAY_INSERTfunction (Spark semantics). -
ARRAY_INTERSECT
ARRAY_INTERSECTfunction (Spark semantics). -
ARRAY_JOIN
ARRAY_JOINfunction (Spark semantics). -
ARRAY_LENGTH
ARRAY_LENGTHfunction (Spark semantics). -
ARRAY_MAX
ARRAY_MAXfunction (Spark semantics). -
ARRAY_MIN
ARRAY_MINfunction (Spark semantics). -
ARRAY_POSITION
ARRAY_POSITIONfunction (Spark semantics). -
ARRAY_PREPEND
ARRAY_PREPENDfunction (Spark semantics). -
ARRAY_REMOVE
ARRAY_REMOVEfunction (Spark semantics). -
ARRAY_REPEAT
ARRAY_REPEATfunction (Spark semantics). -
ARRAY_REVERSE
ARRAY_REVERSEfunction (BigQuery semantics). -
ARRAY_SIZE
ARRAY_SIZEfunction (Spark semantics). -
ARRAY_SLICE
ARRAY_SLICEfunction (Hive semantics). -
ARRAY_TO_STRING
ARRAY_TO_STRINGfunction (BigQuery semantics). -
ARRAY_UNION
ARRAY_UNIONfunction (Spark semantics). -
ARRAYS_OVERLAP
ARRAYS_OVERLAPfunction (Spark semantics). -
ARRAYS_ZIP
ARRAYS_ZIPfunction (Spark semantics). -
SORT_ARRAY
SORT_ARRAYfunction (Spark semantics). -
MAP_CONCAT
MAP_CONCATfunction (Spark semantics). -
MAP_ENTRIES
MAP_ENTRIESfunction (Spark semantics). -
MAP_KEYS
MAP_KEYSfunction (Spark semantics). -
MAP_VALUES
MAP_VALUESfunction (Spark semantics). -
MAP_CONTAINS_KEY
MAP_CONTAINS_KEYfunction (Spark semantics). -
MAP_FROM_ARRAYS
MAP_FROM_ARRAYSfunction (Spark semantics). -
MAP_FROM_ENTRIES
MAP_FROM_ENTRIESfunction (Spark semantics). -
STR_TO_MAP
STR_TO_MAPfunction (Spark semantics). -
SUBSTRING_INDEX
SUBSTRING_INDEXfunction (Spark semantics). -
REVERSE
REVERSEfunction (SQL Server, MySQL). -
REVERSE_SPARK
REVERSEfunction (Spark semantics). -
SOUNDEX_SPARK
SOUNDEXfunction (Spark semantics). -
SUBSTR_BIG_QUERY
SUBSTRfunction (BigQuery semantics). -
SUBSTR_MYSQL
SUBSTRfunction (MySQL semantics). -
SUBSTR_ORACLE
SUBSTRfunction (Oracle semantics). -
SUBSTR_POSTGRESQL
SUBSTRfunction (PostgreSQL semantics). -
CHAR_LENGTH
CHAR_LENGTHfunction. -
ENDS_WITH
ENDS_WITHfunction. -
STARTS_WITH
STARTS_WITHfunction. -
STRING_TO_ARRAY
STRING_TO_ARRAYfunction (PostgreSQL semantics). -
JDBC_FN
Call to a function using JDBC function syntax. -
MULTISET_VALUE_CONSTRUCTOR
MULTISETvalue constructor. -
MULTISET_QUERY_CONSTRUCTOR
MULTISETquery constructor. -
JSON_VALUE_EXPRESSION
JSONvalue expression. -
JSON_ARRAYAGG
JSON_ARRAYAGGaggregate function. -
JSON_OBJECTAGG
JSON_OBJECTAGGaggregate function. -
JSON_TYPE
JSONtype function. -
UNNEST
UNNESToperator. -
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_TABLEprefix 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
CURSORconstructor, for example,SELECT * FROM TABLE(udx(CURSOR(SELECT ...), x, y, z)). -
CONTAINS_SUBSTR
CONTAINS_SUBSTRfunction (BigQuery semantics). -
LITERAL_AGG
TheLITERAL_AGGaggregate 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 internalEXTENDoperator that qualifies a table name in theFROMclause. -
CUBE
The internalCUBEoperator that occurs within aGROUP BYclause. -
ROLLUP
The internalROLLUPoperator that occurs within aGROUP BYclause. -
GROUPING_SETS
The internalGROUPING SETSoperator that occurs within aGROUP BYclause. -
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
TheCOUNTaggregate function. -
SUM
TheSUMaggregate function. -
SUM0
TheSUM0aggregate function. -
MIN
TheMINaggregate function. -
MAX
TheMAXaggregate function. -
LEAD
TheLEADaggregate function. -
LAG
TheLAGaggregate function. -
FIRST_VALUE
TheFIRST_VALUEaggregate function. -
LAST_VALUE
TheLAST_VALUEaggregate function. -
ANY_VALUE
TheANY_VALUEaggregate function. -
COVAR_POP
TheCOVAR_POPaggregate function. -
COVAR_SAMP
TheCOVAR_SAMPaggregate function. -
REGR_COUNT
TheREGR_COUNTaggregate function. -
REGR_SXX
TheREGR_SXXaggregate function. -
REGR_SYY
TheREGR_SYYaggregate function. -
AVG
TheAVGaggregate function. -
STDDEV_POP
TheSTDDEV_POPaggregate function. -
STDDEV_SAMP
TheSTDDEV_SAMPaggregate function. -
VAR_POP
TheVAR_POPaggregate function. -
VAR_SAMP
TheVAR_SAMPaggregate function. -
NTILE
TheNTILEaggregate function. -
NTH_VALUE
TheNTH_VALUEaggregate function. -
LISTAGG
TheLISTAGGaggregate function. -
STRING_AGG
TheSTRING_AGGaggregate function. -
COUNTIF
TheCOUNTIFaggregate function. -
ARRAY_AGG
TheARRAY_AGGaggregate function. -
ARRAY_CONCAT_AGG
TheARRAY_CONCAT_AGGaggregate function. -
GROUP_CONCAT
TheGROUP_CONCATaggregate function. -
COLLECT
TheCOLLECTaggregate function. -
MODE
TheMODEaggregate function. -
ARG_MAX
TheARG_MAXaggregate function. -
ARG_MIN
TheARG_MINaggregate function. -
PERCENTILE_CONT
ThePERCENTILE_CONTaggregate function. -
PERCENTILE_DISC
ThePERCENTILE_DISCaggregate function. -
FUSION
TheFUSIONaggregate function. -
INTERSECTION
TheINTERSECTIONaggregate function. -
SINGLE_VALUE
TheSINGLE_VALUEaggregate function. -
AGGREGATE_FN
TheAGGREGATEaggregate function. -
BITAND
TheBITANDscalar function. -
BITOR
TheBITORscalar function. -
BITXOR
TheBITXORscalar function. -
BITNOT
TheBITNOTscalar function. -
BIT_AND
TheBIT_ANDaggregate function. -
BIT_OR
TheBIT_ORaggregate function. -
BIT_XOR
TheBIT_XORaggregate function. -
ROW_NUMBER
TheROW_NUMBERwindow function. -
RANK
TheRANKwindow function. -
PERCENT_RANK
ThePERCENT_RANKwindow function. -
DENSE_RANK
TheDENSE_RANKwindow function. -
CUME_DIST
TheROW_NUMBERwindow function. -
DESCRIPTOR
TheDESCRIPTOR(column_name, ...). -
TUMBLE
TheTUMBLEgroup function. -
TUMBLE_START
TheTUMBLE_STARTauxiliary function of theTUMBLEgroup function. -
TUMBLE_END
TheTUMBLE_ENDauxiliary function of theTUMBLEgroup function. -
HOP
TheHOPgroup function. -
HOP_START
TheHOP_STARTauxiliary function of theHOPgroup function. -
HOP_END
TheHOP_ENDauxiliary function of theHOPgroup function. -
SESSION
TheSESSIONgroup function. -
SESSION_START
TheSESSION_STARTauxiliary function of theSESSIONgroup function. -
SESSION_END
TheSESSION_ENDauxiliary function of theSESSIONgroup function. -
COLUMN_DECL
Column declaration. -
ATTRIBUTE_DEF
Attribute definition. -
CHECK
CHECKconstraint. -
UNIQUE
UNIQUEconstraint. -
PRIMARY_KEY
PRIMARY KEYconstraint. -
FOREIGN_KEY
FOREIGN KEYconstraint. -
ST_DWITHIN
TheST_DWithingeo-spatial function. -
ST_POINT
TheST_Pointfunction. -
ST_POINT3
TheST_Pointfunction that makes a 3D point. -
ST_MAKE_LINE
TheST_MakeLinefunction that makes a line. -
ST_CONTAINS
TheST_Containsfunction that tests whether one geometry contains another. -
HILBERT
TheHilbertfunction that converts (x, y) to a position on a Hilbert space-filling curve. -
COMMIT
COMMITsession control statement. -
ROLLBACK
ROLLBACKsession control statement. -
ALTER_SESSION
ALTER SESSIONDDL statement. -
CREATE_SCHEMA
CREATE SCHEMADDL statement. -
CREATE_FOREIGN_SCHEMA
CREATE FOREIGN SCHEMADDL statement. -
DROP_SCHEMA
DROP SCHEMADDL statement. -
CREATE_TABLE
CREATE TABLEDDL statement. -
CREATE_TABLE_LIKE
CREATE TABLE LIKEDDL statement. -
ALTER_TABLE
ALTER TABLEDDL statement. -
DROP_TABLE
DROP TABLEDDL statement. -
TRUNCATE_TABLE
TRUNCATE TABLEDDL statement. -
CREATE_VIEW
CREATE VIEWDDL statement. -
ALTER_VIEW
ALTER VIEWDDL statement. -
DROP_VIEW
DROP VIEWDDL statement. -
CREATE_MATERIALIZED_VIEW
CREATE MATERIALIZED VIEWDDL statement. -
ALTER_MATERIALIZED_VIEW
ALTER MATERIALIZED VIEWDDL statement. -
DROP_MATERIALIZED_VIEW
DROP MATERIALIZED VIEWDDL statement. -
CREATE_SEQUENCE
CREATE SEQUENCEDDL statement. -
ALTER_SEQUENCE
ALTER SEQUENCEDDL statement. -
DROP_SEQUENCE
DROP SEQUENCEDDL statement. -
CREATE_INDEX
CREATE INDEXDDL statement. -
ALTER_INDEX
ALTER INDEXDDL statement. -
DROP_INDEX
DROP INDEXDDL statement. -
CREATE_TYPE
CREATE TYPEDDL statement. -
DROP_TYPE
DROP TYPEDDL statement. -
CREATE_FUNCTION
CREATE FUNCTIONDDL statement. -
DROP_FUNCTION
DROP FUNCTIONDDL 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,UNNESTor 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
-
CHECKED_ARITHMETIC
-
BINARY_EQUALITY
Category of binary equality.Consists of:
EQUALSNOT_EQUALS -
BINARY_COMPARISON
Category of binary comparison.Consists of:
EQUALSNOT_EQUALSGREATER_THANGREATER_THAN_OR_EQUALLESS_THANLESS_THAN_OR_EQUALIS_DISTINCT_FROMIS_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
INbecause 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_TRUEandIS_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 thisSqlKindbelongs 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.