Enum SqlKind
- java.lang.Object
-
- java.lang.Enum<SqlKind>
-
- org.apache.calcite.sql.SqlKind
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SqlKind>
public enum SqlKind extends java.lang.Enum<SqlKind>
Enumerates the possible types ofSqlNode
.The values are immutable, canonical constants, so you can use Kinds to find particular types of expressions quickly. To identity a call to a common operator such as '=', use
SqlNode.isA(java.util.Set<org.apache.calcite.sql.SqlKind>)
:exp.
isA
(EQUALS
)Only commonly-used nodes have their own type; other nodes are of type
OTHER
. Some of the values, such asSET_QUERY
, represent aggregates.To quickly choose between a number of options, use a switch statement:
switch (exp.getKind()) { case
EQUALS
: ...; caseNOT_EQUALS
: ...; default: throw new AssertionError("unexpected"); }Note that we do not even have to check that a
SqlNode
is aSqlCall
.To identify a category of expressions, use
SqlNode.isA
with an aggregate SqlKind. The following expression will returntrue
for calls to '=' and '>=', butfalse
for the constant '5', or a call to '+':exp.isA(
SqlKind.COMPARISON
)RexNode also has a
getKind
method;SqlKind
values are preserved during translation fromSqlNode
toRexNode
, 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 forAND
,OR
andEQUALS
, the enum helps.(If we were using Scala,
SqlOperator
would be a case class, and we wouldn't needSqlKind
. But we're not.)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALL
The "ALL" quantification operator.ALTER_INDEX
ALTER INDEX
DDL statement.ALTER_MATERIALIZED_VIEW
ALTER MATERIALIZED VIEW
DDL statement.ALTER_SEQUENCE
ALTER SEQUENCE
DDL statement.ALTER_SESSION
ALTER SESSION
DDL statement.ALTER_TABLE
ALTER TABLE
DDL statement.ALTER_VIEW
ALTER VIEW
DDL statement.AND
The logical "AND" operator.ANY_VALUE
TheANY_VALUE
aggregate function.ARGUMENT_ASSIGNMENT
ARGUMENT_ASSIGNMENT operator,=>
ARRAY_QUERY_CONSTRUCTOR
Array Query Constructor, e.g.ARRAY_VALUE_CONSTRUCTOR
Array Value Constructor, e.g.AS
AS operatorATTRIBUTE_DEF
Attribute definition.AVG
TheAVG
aggregate function.BETWEEN
The "BETWEEN" operator.CASE
A "CASE" expression.CAST
The "CAST" operator.CEIL
The "CEIL" functionCHECK
CHECK
constraint.CLASSIFIER
COALESCE
The "COALESCE" operator.COLLECT
TheCOLLECT
aggregate function.COLLECTION_TABLE
Table operator which converts user-defined transform into a relation, for example,select * from TABLE(udx(x, y, z))
.COLUMN_DECL
Column declaration.COLUMN_LIST
The non-standard constructor used to pass a COLUMN_LIST parameter to a user-defined transform.COMMIT
COMMIT
session control statement.CONTAINS
The "CONTAINS" operator for periods.CORREL_VARIABLE
Reference to correlation variable.COUNT
TheCOUNT
aggregate function.COVAR_POP
TheCOVAR_POP
aggregate function.COVAR_SAMP
TheCOVAR_SAMP
aggregate function.CREATE_FOREIGN_SCHEMA
CREATE FOREIGN SCHEMA
DDL statement.CREATE_FUNCTION
CREATE FUNCTION
DDL statement.CREATE_INDEX
CREATE INDEX
DDL statement.CREATE_MATERIALIZED_VIEW
CREATE MATERIALIZED VIEW
DDL statement.CREATE_SCHEMA
CREATE SCHEMA
DDL statement.CREATE_SEQUENCE
CREATE SEQUENCE
DDL statement.CREATE_TABLE
CREATE TABLE
DDL statement.CREATE_TYPE
CREATE TYPE
DDL statement.CREATE_VIEW
CREATE VIEW
DDL statement.CUBE
The internalCUBE
operator that occurs within aGROUP BY
clause.CUME_DIST
TheROW_NUMBER
window function.CURRENT_VALUE
The "CURRENT VALUE OF sequence" operator.CURSOR
CURSOR constructor, for example,select * from TABLE(udx(CURSOR(select ...), x, y, z))
DECODE
The "DECODE" function (Oracle).DEFAULT
DEFAULT operatorDELETE
DELETE statementDENSE_RANK
TheDENSE_RANK
window function.DESCENDING
DESC in ORDER BY.DESCRIBE_SCHEMA
DESCRIBE SCHEMA statementDESCRIBE_TABLE
DESCRIBE TABLE statementDIVIDE
The arithmetic division operator, "/".DOT
DotDROP_FUNCTION
DROP FUNCTION
DDL statement.DROP_INDEX
DROP INDEX
DDL statement.DROP_MATERIALIZED_VIEW
DROP MATERIALIZED VIEW
DDL statement.DROP_SCHEMA
DROP SCHEMA
DDL statement.DROP_SEQUENCE
DROP SEQUENCE
DDL statement.DROP_TABLE
DROP TABLE
DDL statement.DROP_TYPE
DROP TYPE
DDL statement.DROP_VIEW
DROP VIEW
DDL statement.DYNAMIC_PARAM
A dynamic parameter.EQUALS
The equals operator, "=".ESCAPE
Escape operator (always part of LIKE or SIMILAR TO expression).EXCEPT
ExceptEXISTS
The "EXISTS" operator.EXPLAIN
EXPLAIN statementEXPLICIT_TABLE
Explicit table, e.g.EXTEND
The internalEXTEND
operator that qualifies a table name in theFROM
clause.EXTRACT
The "EXTRACT" function.FIELD_ACCESS
The field access operator, ".".FILTER
FILTER operatorFINAL
Special functions in MATCH_RECOGNIZE.FIRST
FIRST_VALUE
TheFIRST_VALUE
aggregate function.FLOOR
The "FLOOR" functionFOLLOWING
The "FOLLOWING" qualifier of an interval end-point in a window specification.FOREIGN_KEY
FOREIGN KEY
constraint.FUSION
TheFUSION
aggregate function.GREATER_THAN
The greater-than operator, ">".GREATER_THAN_OR_EQUAL
The greater-than-or-equal operator, ">=".GREATEST
The "GREATEST" function (Oracle).GROUP_ID
TheGROUP_ID()
function.GROUPING
TheGROUPING(e, ...)
function.GROUPING_ID
Deprecated.UseGROUPING
.GROUPING_SETS
The internalGROUPING SETS
operator that occurs within aGROUP BY
clause.HOP
TheHOP
group function.HOP_END
TheHOP_END
auxiliary function of theHOP
group function.HOP_START
TheHOP_START
auxiliary function of theHOP
group function.IDENTIFIER
IdentifierIMMEDIATELY_PRECEDES
The "IMMEDIATELY PRECEDES" operator for periods.IMMEDIATELY_SUCCEEDS
The "IMMEDIATELY SUCCEEDS" operator for periods.IN
The "IN" operator.INPUT_REF
Reference to an input field.INSERT
INSERT statementINTERSECT
IntersectIS_DISTINCT_FROM
The is-distinct-from operator.IS_FALSE
The "IS FALSE" operator.IS_NOT_DISTINCT_FROM
The is-not-distinct-from operator.IS_NOT_FALSE
The "IS NOT FALSE" operator.IS_NOT_NULL
The "IS NOT NULL" operator.IS_NOT_TRUE
The "IS NOT TRUE" operator.IS_NULL
The "IS NULL" operator.IS_TRUE
The "IS TRUE" operator.IS_UNKNOWN
The "IS UNKNOWN" operator.JDBC_FN
Call to a function using JDBC function syntax.JOIN
JOIN operator or compound FROM clause.JSON_API_COMMON_SYNTAX
The JSON API common syntax.JSON_ARRAYAGG
TheJSON_ARRAYAGG
aggregate function.JSON_OBJECTAGG
TheJSON_OBJECTAGG
aggregate function.JSON_VALUE_EXPRESSION
The JSON value expression.LAG
TheLAG
aggregate function.LAST
LAST_VALUE
TheLAST_VALUE
aggregate function.LATERAL
The "LATERAL" qualifier to relations in the FROM clause.LEAD
TheLEAD
aggregate function.LEAST
The "LEAST" function (Oracle).LESS_THAN
The less-than operator, "<".LESS_THAN_OR_EQUAL
The less-than-or-equal operator, "<=".LIKE
The "LIKE" operator.LITERAL
A literal.LITERAL_CHAIN
Literal chain operator (for composite string literals).LOCAL_REF
Reference to a sub-expression computed within the current relational operator.LTRIM
The "LTRIM" function (Oracle).MAP_QUERY_CONSTRUCTOR
Map Query Constructor, e.g.MAP_VALUE_CONSTRUCTOR
Map Value Constructor, e.g.MATCH_NUMBER
MATCH_RECOGNIZE
MATCH_RECOGNIZE clauseMAX
TheMAX
aggregate function.MERGE
MERGE statementMIN
TheMIN
aggregate function.MINUS
The arithmetic minus operator, "-".MINUS_PREFIX
The unary minus operator, as in "-1".MOD
The arithmetic remainder operator, "MOD" (and "%" in some dialects).MULTISET_QUERY_CONSTRUCTOR
The MULTISET query constructor.MULTISET_VALUE_CONSTRUCTOR
The MULTISET value constructor.NEW_SPECIFICATION
NewSpecificationNEXT
NEXT_VALUE
The "NEXT VALUE OF sequence" operator.NOT
The logical "NOT" operator.NOT_EQUALS
The not-equals operator, "!=" or "<>".NOT_IN
The "NOT IN" operator.NTH_VALUE
TheNTH_VALUE
aggregate function.NTILE
TheNTILE
aggregate function.NULLIF
The "NULLIF" operator.NULLS_FIRST
NULLS FIRST clause in ORDER BY.NULLS_LAST
NULLS LAST clause in ORDER BY.NVL
The "NVL" function (Oracle).OR
The logical "OR" operator.ORDER_BY
ORDER BY clause.OTHER
Expression not covered by any otherSqlKind
value.OTHER_DDL
DDL statement not handled above.OTHER_FUNCTION
Function that is not a special function.OVER
OVER operatorOVERLAPS
The "OVERLAPS" operator for periods.PATTERN_ALTER
the alternation operator in a pattern expression within a match_recognize clausePATTERN_CONCAT
the concatenation operator in a pattern expression within a match_recognize clausePATTERN_EXCLUDED
The special patterns to exclude enclosing pattern from output in a MATCH_RECOGNIZE clause.PATTERN_INPUT_REF
Reference to an input field, with pattern var as modifierPATTERN_PERMUTE
The internal "permute" function in a MATCH_RECOGNIZE clause.PATTERN_QUANTIFIER
the repetition quantifier of a pattern factor in a match_recognize clause.PERCENT_RANK
ThePERCENT_RANK
window function.PERIOD_EQUALS
The "EQUALS" operator for periods.PLUS
The arithmetic plus operator, "+".PLUS_PREFIX
The unary plus operator, as in "+1".PRECEDES
The "PRECEDES" operator for periods.PRECEDING
The "PRECEDING" qualifier of an interval end-point in a window specification.PREV
PRIMARY_KEY
PRIMARY KEY
constraint.PROCEDURE_CALL
ProcedureCallRANK
TheRANK
window function.REGR_COUNT
TheREGR_COUNT
aggregate function.REGR_SXX
TheREGR_SXX
aggregate function.REGR_SYY
TheREGR_SYY
aggregate function.REINTERPRET
The internal REINTERPRET operator (meaning a reinterpret cast).ROLLBACK
ROLLBACK
session control statement.ROLLUP
The internalROLLUP
operator that occurs within aGROUP BY
clause.ROW
The row-constructor function.ROW_NUMBER
TheROW_NUMBER
window function.RTRIM
The "RTRIM" function (Oracle).RUNNING
SCALAR_QUERY
Scalar query; that is, a sub-query used in an expression context, and returning one row and one column.SELECT
SELECT statement or sub-query.SESSION
TheSESSION
group function.SESSION_END
TheSESSION_END
auxiliary function of theSESSION
group function.SESSION_START
TheSESSION_START
auxiliary function of theSESSION
group function.SET_OPTION
"ALTER scope SET option = value" statement.SIMILAR
The "SIMILAR" operator.SINGLE_VALUE
TheSINGLE_VALUE
aggregate function.SKIP_TO_FIRST
The "SKIP TO FIRST" qualifier of restarting point in a MATCH_RECOGNIZE clause.SKIP_TO_LAST
The "SKIP TO LAST" qualifier of restarting point in a MATCH_RECOGNIZE clause.SOME
The "SOME" quantification operator (also called "ANY").STDDEV_POP
TheSTDDEV_POP
aggregate function.STDDEV_SAMP
TheSTDDEV_SAMP
aggregate function.SUCCEEDS
The "SUCCEEDS" operator for periods.SUM
TheSUM
aggregate function.SUM0
TheSUM0
aggregate function.TABLE_INPUT_REF
Reference to an input field, with a qualified name and an identifierTABLESAMPLE
TABLESAMPLE operatorTIMES
The arithmetic multiplication operator, "*".TIMESTAMP_ADD
The "TIMESTAMP_ADD" function (ODBC, SQL Server, MySQL).TIMESTAMP_DIFF
The "TIMESTAMP_DIFF" function (ODBC, SQL Server, MySQL).TRIM
The "TRIM" function.TUMBLE
TheTUMBLE
group function.TUMBLE_END
TheTUMBLE_END
auxiliary function of theTUMBLE
group function.TUMBLE_START
TheTUMBLE_START
auxiliary function of theTUMBLE
group function.UNION
UnionUNIQUE
UNIQUE
constraint.UNNEST
The "UNNEST" operator.UPDATE
UPDATE statementVALUES
The "VALUES" operator.VAR_POP
TheVAR_POP
aggregate function.VAR_SAMP
TheVAR_SAMP
aggregate function.WINDOW
Window specificationWITH
WITH clause.WITH_ITEM
Item in WITH clause.WITHIN_GROUP
WITHIN_GROUP operator
-
Field Summary
Fields Modifier and Type Field Description static java.util.EnumSet<SqlKind>
AGGREGATE
Category consisting of all built-in aggregate functions.static java.util.Set<SqlKind>
AVG_AGG_FUNCTIONS
Category of SqlAvgAggFunction.static java.util.Set<SqlKind>
COMPARISON
Category of comparison operators.static java.util.Set<SqlKind>
COVAR_AVG_AGG_FUNCTIONS
Category of SqlCovarAggFunction.static java.util.EnumSet<SqlKind>
DDL
Category consisting of all DDL operators.static java.util.EnumSet<SqlKind>
DML
Category consisting of all DML operators.static java.util.Set<SqlKind>
EXPRESSION
Category consisting of all expression operators.static java.util.Set<SqlKind>
FUNCTION
Category consisting of regular and special functions.java.lang.String
lowerName
Lower-case name.static java.util.EnumSet<SqlKind>
QUERY
Category consisting of query node types.static java.util.EnumSet<SqlKind>
SET_QUERY
Category consisting of set-query node types.java.lang.String
sql
static java.util.EnumSet<SqlKind>
TOP_LEVEL
Category of all SQL statement types.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
belongsTo(java.util.Collection<SqlKind> category)
Returns whether thisSqlKind
belongs to a given category.private static <E extends java.lang.Enum<E>>
java.util.EnumSet<E>concat(java.util.EnumSet<E> set0, java.util.EnumSet<E>... sets)
SqlKind
negate()
Returns the kind that you get if you apply NOT to this kind.SqlKind
negateNullSafe()
Returns the kind that you get if you negate this kind.SqlKind
reverse()
Returns the kind that corresponds to this operator but in the opposite direction.static SqlKind
valueOf(java.lang.String name)
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 Detail
-
OTHER
public static final SqlKind OTHER
Expression not covered by any otherSqlKind
value.- See Also:
OTHER_FUNCTION
-
SELECT
public static final SqlKind SELECT
SELECT statement or sub-query.
-
JOIN
public static final SqlKind JOIN
JOIN operator or compound FROM clause.A FROM clause with more than one table is represented as if it were a join. For example, "FROM x, y, z" is represented as "JOIN(x, JOIN(x, y))".
-
IDENTIFIER
public static final SqlKind IDENTIFIER
Identifier
-
LITERAL
public static final SqlKind LITERAL
A literal.
-
OTHER_FUNCTION
public static final SqlKind OTHER_FUNCTION
Function that is not a special function.- See Also:
FUNCTION
-
EXPLAIN
public static final SqlKind EXPLAIN
EXPLAIN statement
-
DESCRIBE_SCHEMA
public static final SqlKind DESCRIBE_SCHEMA
DESCRIBE SCHEMA statement
-
DESCRIBE_TABLE
public static final SqlKind DESCRIBE_TABLE
DESCRIBE TABLE statement
-
INSERT
public static final SqlKind INSERT
INSERT statement
-
DELETE
public static final SqlKind DELETE
DELETE statement
-
UPDATE
public static final SqlKind UPDATE
UPDATE statement
-
SET_OPTION
public static final SqlKind SET_OPTION
"ALTER scope SET option = value" statement.
-
DYNAMIC_PARAM
public static final SqlKind DYNAMIC_PARAM
A dynamic parameter.
-
ORDER_BY
public static final SqlKind ORDER_BY
ORDER BY clause.- See Also:
DESCENDING
,NULLS_FIRST
,NULLS_LAST
-
WITH
public static final SqlKind WITH
WITH clause.
-
WITH_ITEM
public static final SqlKind WITH_ITEM
Item in WITH clause.
-
UNION
public static final SqlKind UNION
Union
-
EXCEPT
public static final SqlKind EXCEPT
Except
-
INTERSECT
public static final SqlKind INTERSECT
Intersect
-
AS
public static final SqlKind AS
AS operator
-
ARGUMENT_ASSIGNMENT
public static final SqlKind ARGUMENT_ASSIGNMENT
ARGUMENT_ASSIGNMENT operator,=>
-
DEFAULT
public static final SqlKind DEFAULT
DEFAULT operator
-
OVER
public static final SqlKind OVER
OVER operator
-
FILTER
public static final SqlKind FILTER
FILTER operator
-
WITHIN_GROUP
public static final SqlKind WITHIN_GROUP
WITHIN_GROUP operator
-
WINDOW
public static final SqlKind WINDOW
Window specification
-
MERGE
public static final SqlKind MERGE
MERGE statement
-
TABLESAMPLE
public static final SqlKind TABLESAMPLE
TABLESAMPLE operator
-
MATCH_RECOGNIZE
public static final SqlKind MATCH_RECOGNIZE
MATCH_RECOGNIZE clause
-
TIMES
public static final SqlKind TIMES
The arithmetic multiplication operator, "*".
-
DIVIDE
public static final SqlKind DIVIDE
The arithmetic division operator, "/".
-
MOD
public static final SqlKind MOD
The arithmetic remainder operator, "MOD" (and "%" in some dialects).
-
PLUS
public static final SqlKind PLUS
The arithmetic plus operator, "+".- See Also:
PLUS_PREFIX
-
MINUS
public static final SqlKind MINUS
The arithmetic minus operator, "-".- See Also:
MINUS_PREFIX
-
PATTERN_ALTER
public static final SqlKind PATTERN_ALTER
the alternation operator in a pattern expression within a match_recognize clause
-
PATTERN_CONCAT
public static final SqlKind PATTERN_CONCAT
the concatenation operator in a pattern expression within a match_recognize clause
-
IN
public static final SqlKind IN
The "IN" operator.
-
NOT_IN
public static final SqlKind NOT_IN
The "NOT IN" operator.Only occurs in SqlNode trees. Is expanded to NOT(IN ...) before entering RelNode land.
-
LESS_THAN
public static final SqlKind LESS_THAN
The less-than operator, "<".
-
GREATER_THAN
public static final SqlKind GREATER_THAN
The greater-than operator, ">".
-
LESS_THAN_OR_EQUAL
public static final SqlKind LESS_THAN_OR_EQUAL
The less-than-or-equal operator, "<=".
-
GREATER_THAN_OR_EQUAL
public static final SqlKind GREATER_THAN_OR_EQUAL
The greater-than-or-equal operator, ">=".
-
EQUALS
public static final SqlKind EQUALS
The equals operator, "=".
-
NOT_EQUALS
public static final SqlKind NOT_EQUALS
The not-equals operator, "!=" or "<>". The latter is standard, and preferred.
-
IS_DISTINCT_FROM
public static final SqlKind IS_DISTINCT_FROM
The is-distinct-from operator.
-
IS_NOT_DISTINCT_FROM
public static final SqlKind IS_NOT_DISTINCT_FROM
The is-not-distinct-from operator.
-
OR
public static final SqlKind OR
The logical "OR" operator.
-
AND
public static final SqlKind AND
The logical "AND" operator.
-
DOT
public static final SqlKind DOT
Dot
-
OVERLAPS
public static final SqlKind OVERLAPS
The "OVERLAPS" operator for periods.
-
CONTAINS
public static final SqlKind CONTAINS
The "CONTAINS" operator for periods.
-
PRECEDES
public static final SqlKind PRECEDES
The "PRECEDES" operator for periods.
-
IMMEDIATELY_PRECEDES
public static final SqlKind IMMEDIATELY_PRECEDES
The "IMMEDIATELY PRECEDES" operator for periods.
-
SUCCEEDS
public static final SqlKind SUCCEEDS
The "SUCCEEDS" operator for periods.
-
IMMEDIATELY_SUCCEEDS
public static final SqlKind IMMEDIATELY_SUCCEEDS
The "IMMEDIATELY SUCCEEDS" operator for periods.
-
PERIOD_EQUALS
public static final SqlKind PERIOD_EQUALS
The "EQUALS" operator for periods.
-
LIKE
public static final SqlKind LIKE
The "LIKE" operator.
-
SIMILAR
public static final SqlKind SIMILAR
The "SIMILAR" operator.
-
BETWEEN
public static final SqlKind BETWEEN
The "BETWEEN" operator.
-
CASE
public static final SqlKind CASE
A "CASE" expression.
-
NULLIF
public static final SqlKind NULLIF
The "NULLIF" operator.
-
COALESCE
public static final SqlKind COALESCE
The "COALESCE" operator.
-
DECODE
public static final SqlKind DECODE
The "DECODE" function (Oracle).
-
NVL
public static final SqlKind NVL
The "NVL" function (Oracle).
-
GREATEST
public static final SqlKind GREATEST
The "GREATEST" function (Oracle).
-
LEAST
public static final SqlKind LEAST
The "LEAST" function (Oracle).
-
TIMESTAMP_ADD
public static final SqlKind TIMESTAMP_ADD
The "TIMESTAMP_ADD" function (ODBC, SQL Server, MySQL).
-
TIMESTAMP_DIFF
public static final SqlKind TIMESTAMP_DIFF
The "TIMESTAMP_DIFF" function (ODBC, SQL Server, MySQL).
-
NOT
public static final SqlKind NOT
The logical "NOT" operator.
-
PLUS_PREFIX
public static final SqlKind PLUS_PREFIX
The unary plus operator, as in "+1".- See Also:
PLUS
-
MINUS_PREFIX
public static final SqlKind MINUS_PREFIX
The unary minus operator, as in "-1".- See Also:
MINUS
-
EXISTS
public static final SqlKind EXISTS
The "EXISTS" operator.
-
SOME
public static final SqlKind SOME
The "SOME" quantification operator (also called "ANY").
-
ALL
public static final SqlKind ALL
The "ALL" quantification operator.
-
VALUES
public static final SqlKind VALUES
The "VALUES" operator.
-
EXPLICIT_TABLE
public static final SqlKind EXPLICIT_TABLE
-
SCALAR_QUERY
public static final SqlKind SCALAR_QUERY
Scalar query; that is, a sub-query used in an expression context, and returning one row and one column.
-
PROCEDURE_CALL
public static final SqlKind PROCEDURE_CALL
ProcedureCall
-
NEW_SPECIFICATION
public static final SqlKind NEW_SPECIFICATION
NewSpecification
-
FINAL
public static final SqlKind FINAL
Special functions in MATCH_RECOGNIZE.
-
RUNNING
public static final SqlKind RUNNING
-
PREV
public static final SqlKind PREV
-
NEXT
public static final SqlKind NEXT
-
FIRST
public static final SqlKind FIRST
-
LAST
public static final SqlKind LAST
-
CLASSIFIER
public static final SqlKind CLASSIFIER
-
MATCH_NUMBER
public static final SqlKind MATCH_NUMBER
-
SKIP_TO_FIRST
public static final SqlKind SKIP_TO_FIRST
The "SKIP TO FIRST" qualifier of restarting point in a MATCH_RECOGNIZE clause.
-
SKIP_TO_LAST
public static final SqlKind SKIP_TO_LAST
The "SKIP TO LAST" qualifier of restarting point in a MATCH_RECOGNIZE clause.
-
DESCENDING
public static final SqlKind DESCENDING
DESC in ORDER BY. A parse tree, not a true expression.
-
NULLS_FIRST
public static final SqlKind NULLS_FIRST
NULLS FIRST clause in ORDER BY. A parse tree, not a true expression.
-
NULLS_LAST
public static final SqlKind NULLS_LAST
NULLS LAST clause in ORDER BY. A parse tree, not a true expression.
-
IS_TRUE
public static final SqlKind IS_TRUE
The "IS TRUE" operator.
-
IS_FALSE
public static final SqlKind IS_FALSE
The "IS FALSE" operator.
-
IS_NOT_TRUE
public static final SqlKind IS_NOT_TRUE
The "IS NOT TRUE" operator.
-
IS_NOT_FALSE
public static final SqlKind IS_NOT_FALSE
The "IS NOT FALSE" operator.
-
IS_UNKNOWN
public static final SqlKind IS_UNKNOWN
The "IS UNKNOWN" operator.
-
IS_NULL
public static final SqlKind IS_NULL
The "IS NULL" operator.
-
IS_NOT_NULL
public static final SqlKind IS_NOT_NULL
The "IS NOT NULL" operator.
-
PRECEDING
public static final SqlKind PRECEDING
The "PRECEDING" qualifier of an interval end-point in a window specification.
-
FOLLOWING
public static final SqlKind FOLLOWING
The "FOLLOWING" qualifier of an interval end-point in a window specification.
-
FIELD_ACCESS
public static final SqlKind FIELD_ACCESS
The field access operator, ".".(Only used at the RexNode level; at SqlNode level, a field-access is part of an identifier.)
-
INPUT_REF
public static final SqlKind INPUT_REF
Reference to an input field.(Only used at the RexNode level.)
-
TABLE_INPUT_REF
public static final SqlKind TABLE_INPUT_REF
Reference to an input field, with a qualified name and an identifier(Only used at the RexNode level.)
-
PATTERN_INPUT_REF
public static final SqlKind PATTERN_INPUT_REF
Reference to an input field, with pattern var as modifier(Only used at the RexNode level.)
-
LOCAL_REF
public static final SqlKind LOCAL_REF
Reference to a sub-expression computed within the current relational operator.(Only used at the RexNode level.)
-
CORREL_VARIABLE
public static final SqlKind CORREL_VARIABLE
Reference to correlation variable.(Only used at the RexNode level.)
-
PATTERN_QUANTIFIER
public static final SqlKind PATTERN_QUANTIFIER
the repetition quantifier of a pattern factor in a match_recognize clause.
-
ROW
public static final SqlKind ROW
The row-constructor function. May be explicit or implicit:VALUES 1, ROW (2)
.
-
COLUMN_LIST
public static final SqlKind COLUMN_LIST
The non-standard constructor used to pass a COLUMN_LIST parameter to a user-defined transform.
-
CAST
public static final SqlKind CAST
The "CAST" operator.
-
NEXT_VALUE
public static final SqlKind NEXT_VALUE
The "NEXT VALUE OF sequence" operator.
-
CURRENT_VALUE
public static final SqlKind CURRENT_VALUE
The "CURRENT VALUE OF sequence" operator.
-
FLOOR
public static final SqlKind FLOOR
The "FLOOR" function
-
CEIL
public static final SqlKind CEIL
The "CEIL" function
-
TRIM
public static final SqlKind TRIM
The "TRIM" function.
-
LTRIM
public static final SqlKind LTRIM
The "LTRIM" function (Oracle).
-
RTRIM
public static final SqlKind RTRIM
The "RTRIM" function (Oracle).
-
EXTRACT
public static final SqlKind EXTRACT
The "EXTRACT" function.
-
JDBC_FN
public static final SqlKind JDBC_FN
Call to a function using JDBC function syntax.
-
MULTISET_VALUE_CONSTRUCTOR
public static final SqlKind MULTISET_VALUE_CONSTRUCTOR
The MULTISET value constructor.
-
MULTISET_QUERY_CONSTRUCTOR
public static final SqlKind MULTISET_QUERY_CONSTRUCTOR
The MULTISET query constructor.
-
JSON_VALUE_EXPRESSION
public static final SqlKind JSON_VALUE_EXPRESSION
The JSON value expression.
-
JSON_API_COMMON_SYNTAX
public static final SqlKind JSON_API_COMMON_SYNTAX
The JSON API common syntax.
-
JSON_ARRAYAGG
public static final SqlKind JSON_ARRAYAGG
TheJSON_ARRAYAGG
aggregate function.
-
JSON_OBJECTAGG
public static final SqlKind JSON_OBJECTAGG
TheJSON_OBJECTAGG
aggregate function.
-
UNNEST
public static final SqlKind UNNEST
The "UNNEST" operator.
-
LATERAL
public static final SqlKind LATERAL
The "LATERAL" qualifier to relations in the FROM clause.
-
COLLECTION_TABLE
public static final SqlKind COLLECTION_TABLE
Table operator which converts user-defined transform into a relation, for example,select * from TABLE(udx(x, y, z))
. See also theEXPLICIT_TABLE
prefix operator.
-
ARRAY_VALUE_CONSTRUCTOR
public static final SqlKind ARRAY_VALUE_CONSTRUCTOR
Array Value Constructor, e.g.Array[1, 2, 3]
.
-
ARRAY_QUERY_CONSTRUCTOR
public static final SqlKind ARRAY_QUERY_CONSTRUCTOR
Array Query Constructor, e.g.Array(select deptno from dept)
.
-
MAP_VALUE_CONSTRUCTOR
public static final SqlKind MAP_VALUE_CONSTRUCTOR
Map Value Constructor, e.g.Map['washington', 1, 'obama', 44]
.
-
MAP_QUERY_CONSTRUCTOR
public static final SqlKind MAP_QUERY_CONSTRUCTOR
Map Query Constructor, e.g.MAP (SELECT empno, deptno FROM emp)
.
-
CURSOR
public static final SqlKind CURSOR
CURSOR constructor, for example,select * from TABLE(udx(CURSOR(select ...), x, y, z))
-
LITERAL_CHAIN
public static final SqlKind LITERAL_CHAIN
Literal chain operator (for composite string literals). An internal operator that does not appear in SQL syntax.
-
ESCAPE
public static final SqlKind ESCAPE
Escape operator (always part of LIKE or SIMILAR TO expression). An internal operator that does not appear in SQL syntax.
-
REINTERPRET
public static final SqlKind REINTERPRET
The internal REINTERPRET operator (meaning a reinterpret cast). An internal operator that does not appear in SQL syntax.
-
EXTEND
public static final SqlKind EXTEND
The internalEXTEND
operator that qualifies a table name in theFROM
clause.
-
CUBE
public static final SqlKind CUBE
The internalCUBE
operator that occurs within aGROUP BY
clause.
-
ROLLUP
public static final SqlKind ROLLUP
The internalROLLUP
operator that occurs within aGROUP BY
clause.
-
GROUPING_SETS
public static final SqlKind GROUPING_SETS
The internalGROUPING SETS
operator that occurs within aGROUP BY
clause.
-
GROUPING
public static final SqlKind GROUPING
TheGROUPING(e, ...)
function.
-
GROUP_ID
public static final SqlKind GROUP_ID
TheGROUP_ID()
function.
-
PATTERN_PERMUTE
public static final SqlKind PATTERN_PERMUTE
The internal "permute" function in a MATCH_RECOGNIZE clause.
-
PATTERN_EXCLUDED
public static final SqlKind PATTERN_EXCLUDED
The special patterns to exclude enclosing pattern from output in a MATCH_RECOGNIZE clause.
-
COUNT
public static final SqlKind COUNT
TheCOUNT
aggregate function.
-
SUM
public static final SqlKind SUM
TheSUM
aggregate function.
-
SUM0
public static final SqlKind SUM0
TheSUM0
aggregate function.
-
MIN
public static final SqlKind MIN
TheMIN
aggregate function.
-
MAX
public static final SqlKind MAX
TheMAX
aggregate function.
-
LEAD
public static final SqlKind LEAD
TheLEAD
aggregate function.
-
LAG
public static final SqlKind LAG
TheLAG
aggregate function.
-
FIRST_VALUE
public static final SqlKind FIRST_VALUE
TheFIRST_VALUE
aggregate function.
-
LAST_VALUE
public static final SqlKind LAST_VALUE
TheLAST_VALUE
aggregate function.
-
ANY_VALUE
public static final SqlKind ANY_VALUE
TheANY_VALUE
aggregate function.
-
COVAR_POP
public static final SqlKind COVAR_POP
TheCOVAR_POP
aggregate function.
-
COVAR_SAMP
public static final SqlKind COVAR_SAMP
TheCOVAR_SAMP
aggregate function.
-
REGR_COUNT
public static final SqlKind REGR_COUNT
TheREGR_COUNT
aggregate function.
-
REGR_SXX
public static final SqlKind REGR_SXX
TheREGR_SXX
aggregate function.
-
REGR_SYY
public static final SqlKind REGR_SYY
TheREGR_SYY
aggregate function.
-
AVG
public static final SqlKind AVG
TheAVG
aggregate function.
-
STDDEV_POP
public static final SqlKind STDDEV_POP
TheSTDDEV_POP
aggregate function.
-
STDDEV_SAMP
public static final SqlKind STDDEV_SAMP
TheSTDDEV_SAMP
aggregate function.
-
VAR_POP
public static final SqlKind VAR_POP
TheVAR_POP
aggregate function.
-
VAR_SAMP
public static final SqlKind VAR_SAMP
TheVAR_SAMP
aggregate function.
-
NTILE
public static final SqlKind NTILE
TheNTILE
aggregate function.
-
NTH_VALUE
public static final SqlKind NTH_VALUE
TheNTH_VALUE
aggregate function.
-
COLLECT
public static final SqlKind COLLECT
TheCOLLECT
aggregate function.
-
FUSION
public static final SqlKind FUSION
TheFUSION
aggregate function.
-
SINGLE_VALUE
public static final SqlKind SINGLE_VALUE
TheSINGLE_VALUE
aggregate function.
-
ROW_NUMBER
public static final SqlKind ROW_NUMBER
TheROW_NUMBER
window function.
-
RANK
public static final SqlKind RANK
TheRANK
window function.
-
PERCENT_RANK
public static final SqlKind PERCENT_RANK
ThePERCENT_RANK
window function.
-
DENSE_RANK
public static final SqlKind DENSE_RANK
TheDENSE_RANK
window function.
-
CUME_DIST
public static final SqlKind CUME_DIST
TheROW_NUMBER
window function.
-
TUMBLE
public static final SqlKind TUMBLE
TheTUMBLE
group function.
-
TUMBLE_START
public static final SqlKind TUMBLE_START
TheTUMBLE_START
auxiliary function of theTUMBLE
group function.
-
TUMBLE_END
public static final SqlKind TUMBLE_END
TheTUMBLE_END
auxiliary function of theTUMBLE
group function.
-
HOP
public static final SqlKind HOP
TheHOP
group function.
-
HOP_START
public static final SqlKind HOP_START
TheHOP_START
auxiliary function of theHOP
group function.
-
HOP_END
public static final SqlKind HOP_END
TheHOP_END
auxiliary function of theHOP
group function.
-
SESSION
public static final SqlKind SESSION
TheSESSION
group function.
-
SESSION_START
public static final SqlKind SESSION_START
TheSESSION_START
auxiliary function of theSESSION
group function.
-
SESSION_END
public static final SqlKind SESSION_END
TheSESSION_END
auxiliary function of theSESSION
group function.
-
COLUMN_DECL
public static final SqlKind COLUMN_DECL
Column declaration.
-
ATTRIBUTE_DEF
public static final SqlKind ATTRIBUTE_DEF
Attribute definition.
-
CHECK
public static final SqlKind CHECK
CHECK
constraint.
-
UNIQUE
public static final SqlKind UNIQUE
UNIQUE
constraint.
-
PRIMARY_KEY
public static final SqlKind PRIMARY_KEY
PRIMARY KEY
constraint.
-
FOREIGN_KEY
public static final SqlKind FOREIGN_KEY
FOREIGN KEY
constraint.
-
COMMIT
public static final SqlKind COMMIT
COMMIT
session control statement.
-
ROLLBACK
public static final SqlKind ROLLBACK
ROLLBACK
session control statement.
-
ALTER_SESSION
public static final SqlKind ALTER_SESSION
ALTER SESSION
DDL statement.
-
CREATE_SCHEMA
public static final SqlKind CREATE_SCHEMA
CREATE SCHEMA
DDL statement.
-
CREATE_FOREIGN_SCHEMA
public static final SqlKind CREATE_FOREIGN_SCHEMA
CREATE FOREIGN SCHEMA
DDL statement.
-
DROP_SCHEMA
public static final SqlKind DROP_SCHEMA
DROP SCHEMA
DDL statement.
-
CREATE_TABLE
public static final SqlKind CREATE_TABLE
CREATE TABLE
DDL statement.
-
ALTER_TABLE
public static final SqlKind ALTER_TABLE
ALTER TABLE
DDL statement.
-
DROP_TABLE
public static final SqlKind DROP_TABLE
DROP TABLE
DDL statement.
-
CREATE_VIEW
public static final SqlKind CREATE_VIEW
CREATE VIEW
DDL statement.
-
ALTER_VIEW
public static final SqlKind ALTER_VIEW
ALTER VIEW
DDL statement.
-
DROP_VIEW
public static final SqlKind DROP_VIEW
DROP VIEW
DDL statement.
-
CREATE_MATERIALIZED_VIEW
public static final SqlKind CREATE_MATERIALIZED_VIEW
CREATE MATERIALIZED VIEW
DDL statement.
-
ALTER_MATERIALIZED_VIEW
public static final SqlKind ALTER_MATERIALIZED_VIEW
ALTER MATERIALIZED VIEW
DDL statement.
-
DROP_MATERIALIZED_VIEW
public static final SqlKind DROP_MATERIALIZED_VIEW
DROP MATERIALIZED VIEW
DDL statement.
-
CREATE_SEQUENCE
public static final SqlKind CREATE_SEQUENCE
CREATE SEQUENCE
DDL statement.
-
ALTER_SEQUENCE
public static final SqlKind ALTER_SEQUENCE
ALTER SEQUENCE
DDL statement.
-
DROP_SEQUENCE
public static final SqlKind DROP_SEQUENCE
DROP SEQUENCE
DDL statement.
-
CREATE_INDEX
public static final SqlKind CREATE_INDEX
CREATE INDEX
DDL statement.
-
ALTER_INDEX
public static final SqlKind ALTER_INDEX
ALTER INDEX
DDL statement.
-
DROP_INDEX
public static final SqlKind DROP_INDEX
DROP INDEX
DDL statement.
-
CREATE_TYPE
public static final SqlKind CREATE_TYPE
CREATE TYPE
DDL statement.
-
DROP_TYPE
public static final SqlKind DROP_TYPE
DROP TYPE
DDL statement.
-
CREATE_FUNCTION
public static final SqlKind CREATE_FUNCTION
CREATE FUNCTION
DDL statement.
-
DROP_FUNCTION
public static final SqlKind DROP_FUNCTION
DROP FUNCTION
DDL statement.
-
OTHER_DDL
public static final SqlKind OTHER_DDL
DDL statement not handled above.Note to other projects: If you are extending Calcite's SQL parser and have your own object types you no doubt want to define CREATE and DROP commands for them. Use OTHER_DDL in the short term, but we are happy to add new enum values for your object types. Just ask!
-
-
Field Detail
-
SET_QUERY
public static final java.util.EnumSet<SqlKind> SET_QUERY
-
AGGREGATE
public static final java.util.EnumSet<SqlKind> AGGREGATE
Category consisting of all built-in aggregate functions.
-
DML
public static final java.util.EnumSet<SqlKind> 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
public static final java.util.EnumSet<SqlKind> DDL
Category consisting of all DDL operators.
-
QUERY
public static final java.util.EnumSet<SqlKind> QUERY
-
EXPRESSION
public static final java.util.Set<SqlKind> 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
,TRIM
,LITERAL_CHAIN
,JDBC_FN
,PRECEDING
,FOLLOWING
,ORDER_BY
,COLLECTION_TABLE
,TABLESAMPLE
, or an aggregate function, DML or DDL.
-
TOP_LEVEL
public static final java.util.EnumSet<SqlKind> TOP_LEVEL
-
FUNCTION
public static final java.util.Set<SqlKind> FUNCTION
Category consisting of regular and special functions.Consists of regular functions
OTHER_FUNCTION
and special functionsROW
,TRIM
,CAST
,JDBC_FN
.
-
AVG_AGG_FUNCTIONS
public static final java.util.Set<SqlKind> AVG_AGG_FUNCTIONS
Category of SqlAvgAggFunction.Consists of
AVG
,STDDEV_POP
,STDDEV_SAMP
,VAR_POP
,VAR_SAMP
.
-
COVAR_AVG_AGG_FUNCTIONS
public static final java.util.Set<SqlKind> COVAR_AVG_AGG_FUNCTIONS
Category of SqlCovarAggFunction.Consists of
COVAR_POP
,COVAR_SAMP
,REGR_SXX
,REGR_SYY
.
-
COMPARISON
public static final java.util.Set<SqlKind> COMPARISON
Category of comparison operators.Consists of:
IN
,EQUALS
,NOT_EQUALS
,LESS_THAN
,GREATER_THAN
,LESS_THAN_OR_EQUAL
,GREATER_THAN_OR_EQUAL
.
-
lowerName
public final java.lang.String lowerName
Lower-case name.
-
sql
public final java.lang.String sql
-
-
Method Detail
-
values
public static SqlKind[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SqlKind c : SqlKind.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SqlKind valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
reverse
public SqlKind reverse()
Returns the kind that corresponds to this operator but in the opposite direction. Or returns this, if this kind is not reversible.For example,
GREATER_THAN.reverse()
returnsLESS_THAN
.
-
negate
public SqlKind 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
public SqlKind negateNullSafe()
Returns the kind that you get if you negate this kind. To conform to null semantics, null value should not be compared.For
IS_TRUE
,IS_FALSE
,IS_NOT_TRUE
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
public final boolean belongsTo(java.util.Collection<SqlKind> category)
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
-
concat
@SafeVarargs private static <E extends java.lang.Enum<E>> java.util.EnumSet<E> concat(java.util.EnumSet<E> set0, java.util.EnumSet<E>... sets)
-
-