public enum SqlKind extends Enum<SqlKind>
SqlNode.
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 as SET_QUERY, represent
aggregates.
To quickly choose between a number of options, use a switch statement:
switch (exp.getKind()) {
case EQUALS:
...;
case NOT_EQUALS:
...;
default:
throw new AssertionError("unexpected");
}
Note that we do not even have to check that a SqlNode is a
SqlCall.
To identify a category of expressions, use SqlNode.isA with
an aggregate SqlKind. The following expression will return true
for calls to '=' and '>=', but false for the constant '5', or
a call to '+':
exp.isA(SqlKind.COMPARISON)
RexNode also has a getKind method; SqlKind values are
preserved during translation from SqlNode to RexNode, where
applicable.
There is no water-tight definition of "common", but that's OK. There will
always be operators that don't have their own kind, and for these we use the
SqlOperator. But for really the common ones, e.g. the many places
where we are looking for AND, OR and EQUALS, the enum
helps.
(If we were using Scala, SqlOperator would be a case
class, and we wouldn't need SqlKind. But we're not.)
| Enum Constant and 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.
|
ARGUMENT_ASSIGNMENT
ARGUMENT_ASSIGNMENT operator,
=> |
ARRAY_QUERY_CONSTRUCTOR
Array Query Constructor, e.g.
|
ARRAY_VALUE_CONSTRUCTOR
Array Value Constructor, e.g.
|
AS
AS operator
|
AVG
The
AVG aggregate function. |
BETWEEN
The "BETWEEN" operator.
|
CASE
A "CASE" expression.
|
CAST
The "CAST" operator.
|
CEIL
The "CEIL" function
|
CHECK
CHECK constraint. |
CLASSIFIER |
COALESCE
The "COALESCE" operator.
|
COLLECT
The
COLLECT 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
The
COUNT aggregate function. |
COVAR_POP
The
COVAR_POP aggregate function. |
COVAR_SAMP
The
COVAR_SAMP aggregate function. |
CREATE_FOREIGN_SCHEMA
CREATE FOREIGN SCHEMA 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_VIEW
CREATE VIEW DDL statement. |
CUBE
The internal
CUBE operator that occurs within a GROUP BY
clause. |
CUME_DIST
The
ROW_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 operator
|
DELETE
DELETE statement
|
DENSE_RANK
The
DENSE_RANK window function. |
DESCENDING
DESC in ORDER BY.
|
DESCRIBE_SCHEMA
DESCRIBE SCHEMA statement
|
DESCRIBE_TABLE
DESCRIBE TABLE statement
|
DIVIDE
The arithmetic division operator, "/".
|
DOT
Dot
|
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_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
Except
|
EXISTS
The "EXISTS" operator.
|
EXPLAIN
EXPLAIN statement
|
EXPLICIT_TABLE
Explicit table, e.g.
|
EXTEND
The internal
EXTEND operator that qualifies a table name in the
FROM clause. |
EXTRACT
The "EXTRACT" function.
|
FIELD_ACCESS
The field access operator, ".".
|
FILTER
FILTER operator
|
FINAL
Special functions in MATCH_RECOGNIZE.
|
FIRST |
FIRST_VALUE
The
FIRST_VALUE aggregate function. |
FLOOR
The "FLOOR" function
|
FOLLOWING
The "FOLLOWING" qualifier of an interval end-point in a window
specification.
|
FOREIGN_KEY
FOREIGN KEY constraint. |
FUSION
The
FUSION 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
The
GROUP_ID() function. |
GROUPING
The
GROUPING(e, ...) function. |
GROUPING_ID
Deprecated.
Use
GROUPING. |
GROUPING_SETS
The internal
GROUPING SETS operator that occurs within a
GROUP BY clause. |
HOP
The
HOP group function. |
HOP_END
The
HOP_END auxiliary function of
the HOP group function. |
HOP_START
The
HOP_START auxiliary function of
the HOP group function. |
IDENTIFIER
Identifier
|
IMMEDIATELY_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 statement
|
INTERSECT
Intersect
|
IS_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.
|
LAG
The
LAG aggregate function. |
LAST |
LAST_VALUE
The
LAST_VALUE aggregate function. |
LATERAL
The "LATERAL" qualifier to relations in the FROM clause.
|
LEAD
The
LEAD 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 clause
|
MAX
The
MAX aggregate function. |
MERGE
MERGE statement
|
MIN
The
MIN 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
NewSpecification
|
NEXT |
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.
|
NTILE
The
NTILE 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 other
SqlKind value. |
OTHER_DDL
DDL statement not handled above.
|
OTHER_FUNCTION
Function that is not a special function.
|
OVER
OVER operator
|
OVERLAPS
The "OVERLAPS" operator for periods.
|
PATTERN_ALTER
the alternation operator in a pattern expression within a match_recognize clause
|
PATTERN_CONCAT
the concatenation operator in a pattern expression within a match_recognize clause
|
PATTERN_EXCLUDED
the special patterns to exclude enclosing pattern from output in match_recognize clause
|
PATTERN_INPUT_REF
Reference to an input field, with pattern var as modifier
|
PATTERN_PERMUTE
the internal permute function in match_recognize cluse
|
PATTERN_QUANTIFIER
the repetition quantifier of a pattern factor in a match_recognize clause.
|
PERCENT_RANK
The
PERCENT_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
ProcedureCall
|
RANK
The
RANK window function. |
REGR_SXX
The
REGR_SXX aggregate function. |
REGR_SYY
The
REGR_SYY aggregate function. |
REINTERPRET
The internal REINTERPRET operator (meaning a reinterpret cast).
|
ROLLBACK
ROLLBACK session control statement. |
ROLLUP
The internal
ROLLUP operator that occurs within a GROUP BY
clause. |
ROW
The row-constructor function.
|
ROW_NUMBER
The
ROW_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
The
SESSION group function. |
SESSION_END
The
SESSION_END auxiliary function of
the SESSION group function. |
SESSION_START
The
SESSION_START auxiliary function of
the SESSION group function. |
SET_OPTION
"ALTER scope SET option = value" statement.
|
SIMILAR
The "SIMILAR" operator.
|
SINGLE_VALUE
The
SINGLE_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
The
STDDEV_POP aggregate function. |
STDDEV_SAMP
The
STDDEV_SAMP aggregate function. |
SUCCEEDS
The "SUCCEEDS" operator for periods.
|
SUM
The
SUM aggregate function. |
SUM0
The
SUM0 aggregate function. |
TABLE_INPUT_REF
Reference to an input field, with a qualified name and an identifier
|
TABLESAMPLE
TABLESAMPLE operator
|
TIMES
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
The
TUMBLE group function. |
TUMBLE_END
The
TUMBLE_END auxiliary function of
the TUMBLE group function. |
TUMBLE_START
The
TUMBLE_START auxiliary function of
the TUMBLE group function. |
UNION
Union
|
UNIQUE
UNIQUE constraint. |
UNNEST
The "UNNEST" operator.
|
UPDATE
UPDATE statement
|
VALUES
The "VALUES" operator.
|
VAR_POP
The
VAR_POP aggregate function. |
VAR_SAMP
The
VAR_SAMP aggregate function. |
WINDOW
Window specification
|
WITH
WITH clause.
|
WITH_ITEM
Item in WITH clause.
|
| Modifier and Type | Field and Description |
|---|---|
static EnumSet<SqlKind> |
AGGREGATE
Category consisting of all built-in aggregate functions.
|
static Set<SqlKind> |
AVG_AGG_FUNCTIONS
Category of SqlAvgAggFunction.
|
static Set<SqlKind> |
COMPARISON
Category of comparison operators.
|
static EnumSet<SqlKind> |
DDL
Category consisting of all DDL operators.
|
static EnumSet<SqlKind> |
DML
Category consisting of all DML operators.
|
static Set<SqlKind> |
EXPRESSION
Category consisting of all expression operators.
|
static Set<SqlKind> |
FUNCTION
Category consisting of regular and special functions.
|
String |
lowerName
Lower-case name.
|
static EnumSet<SqlKind> |
QUERY
Category consisting of query node types.
|
static EnumSet<SqlKind> |
SET_QUERY
Category consisting of set-query node types.
|
String |
sql |
static EnumSet<SqlKind> |
TOP_LEVEL
Category of all SQL statement types.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
belongsTo(Collection<SqlKind> category)
Returns whether this
SqlKind belongs to a given category. |
private static <E extends Enum<E>> |
concat(EnumSet<E> set0,
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(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.
|
public static final SqlKind OTHER
SqlKind value.OTHER_FUNCTIONpublic static final SqlKind SELECT
public static final SqlKind JOIN
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))".
public static final SqlKind IDENTIFIER
public static final SqlKind LITERAL
public static final SqlKind OTHER_FUNCTION
FUNCTIONpublic static final SqlKind EXPLAIN
public static final SqlKind DESCRIBE_SCHEMA
public static final SqlKind DESCRIBE_TABLE
public static final SqlKind INSERT
public static final SqlKind DELETE
public static final SqlKind UPDATE
public static final SqlKind SET_OPTION
public static final SqlKind DYNAMIC_PARAM
public static final SqlKind ORDER_BY
DESCENDING,
NULLS_FIRST,
NULLS_LASTpublic static final SqlKind WITH
public static final SqlKind WITH_ITEM
public static final SqlKind UNION
public static final SqlKind EXCEPT
public static final SqlKind INTERSECT
public static final SqlKind AS
public static final SqlKind ARGUMENT_ASSIGNMENT
=>public static final SqlKind DEFAULT
public static final SqlKind OVER
public static final SqlKind FILTER
public static final SqlKind WINDOW
public static final SqlKind MERGE
public static final SqlKind TABLESAMPLE
public static final SqlKind MATCH_RECOGNIZE
public static final SqlKind TIMES
public static final SqlKind DIVIDE
public static final SqlKind MOD
public static final SqlKind PLUS
PLUS_PREFIXpublic static final SqlKind MINUS
MINUS_PREFIXpublic static final SqlKind PATTERN_ALTER
public static final SqlKind PATTERN_CONCAT
public static final SqlKind IN
public static final SqlKind NOT_IN
Only occurs in SqlNode trees. Is expanded to NOT(IN ...) before entering RelNode land.
public static final SqlKind LESS_THAN
public static final SqlKind GREATER_THAN
public static final SqlKind LESS_THAN_OR_EQUAL
public static final SqlKind GREATER_THAN_OR_EQUAL
public static final SqlKind EQUALS
public static final SqlKind NOT_EQUALS
public static final SqlKind IS_DISTINCT_FROM
public static final SqlKind IS_NOT_DISTINCT_FROM
public static final SqlKind OR
public static final SqlKind AND
public static final SqlKind DOT
public static final SqlKind OVERLAPS
public static final SqlKind CONTAINS
public static final SqlKind PRECEDES
public static final SqlKind IMMEDIATELY_PRECEDES
public static final SqlKind SUCCEEDS
public static final SqlKind IMMEDIATELY_SUCCEEDS
public static final SqlKind PERIOD_EQUALS
public static final SqlKind LIKE
public static final SqlKind SIMILAR
public static final SqlKind BETWEEN
public static final SqlKind CASE
public static final SqlKind NULLIF
public static final SqlKind COALESCE
public static final SqlKind DECODE
public static final SqlKind NVL
public static final SqlKind GREATEST
public static final SqlKind LEAST
public static final SqlKind TIMESTAMP_ADD
public static final SqlKind TIMESTAMP_DIFF
public static final SqlKind NOT
public static final SqlKind PLUS_PREFIX
PLUSpublic static final SqlKind MINUS_PREFIX
MINUSpublic static final SqlKind EXISTS
public static final SqlKind SOME
public static final SqlKind ALL
public static final SqlKind VALUES
public static final SqlKind EXPLICIT_TABLE
public static final SqlKind SCALAR_QUERY
public static final SqlKind PROCEDURE_CALL
public static final SqlKind NEW_SPECIFICATION
public static final SqlKind FINAL
public static final SqlKind RUNNING
public static final SqlKind PREV
public static final SqlKind NEXT
public static final SqlKind FIRST
public static final SqlKind LAST
public static final SqlKind CLASSIFIER
public static final SqlKind MATCH_NUMBER
public static final SqlKind SKIP_TO_FIRST
public static final SqlKind SKIP_TO_LAST
public static final SqlKind DESCENDING
public static final SqlKind NULLS_FIRST
public static final SqlKind NULLS_LAST
public static final SqlKind IS_TRUE
public static final SqlKind IS_FALSE
public static final SqlKind IS_NOT_TRUE
public static final SqlKind IS_NOT_FALSE
public static final SqlKind IS_UNKNOWN
public static final SqlKind IS_NULL
public static final SqlKind IS_NOT_NULL
public static final SqlKind PRECEDING
public static final SqlKind FOLLOWING
public static final SqlKind FIELD_ACCESS
(Only used at the RexNode level; at SqlNode level, a field-access is part of an identifier.)
public static final SqlKind INPUT_REF
(Only used at the RexNode level.)
public static final SqlKind TABLE_INPUT_REF
(Only used at the RexNode level.)
public static final SqlKind PATTERN_INPUT_REF
(Only used at the RexNode level.)
public static final SqlKind LOCAL_REF
(Only used at the RexNode level.)
public static final SqlKind CORREL_VARIABLE
(Only used at the RexNode level.)
public static final SqlKind PATTERN_QUANTIFIER
public static final SqlKind ROW
VALUES 1, ROW (2).public static final SqlKind COLUMN_LIST
public static final SqlKind CAST
public static final SqlKind NEXT_VALUE
public static final SqlKind CURRENT_VALUE
public static final SqlKind FLOOR
public static final SqlKind CEIL
public static final SqlKind TRIM
public static final SqlKind LTRIM
public static final SqlKind RTRIM
public static final SqlKind EXTRACT
public static final SqlKind JDBC_FN
public static final SqlKind MULTISET_VALUE_CONSTRUCTOR
public static final SqlKind MULTISET_QUERY_CONSTRUCTOR
public static final SqlKind UNNEST
public static final SqlKind LATERAL
public static final SqlKind COLLECTION_TABLE
select * from TABLE(udx(x, y, z)). See also the
EXPLICIT_TABLE prefix operator.public static final SqlKind ARRAY_VALUE_CONSTRUCTOR
Array[1, 2, 3].public static final SqlKind ARRAY_QUERY_CONSTRUCTOR
Array(select deptno from dept).public static final SqlKind MAP_VALUE_CONSTRUCTOR
Map['washington', 1, 'obama', 44].public static final SqlKind MAP_QUERY_CONSTRUCTOR
MAP (SELECT empno, deptno FROM emp).public static final SqlKind CURSOR
select * from
TABLE(udx(CURSOR(select ...), x, y, z))public static final SqlKind LITERAL_CHAIN
public static final SqlKind ESCAPE
public static final SqlKind REINTERPRET
public static final SqlKind EXTEND
EXTEND operator that qualifies a table name in the
FROM clause.public static final SqlKind CUBE
CUBE operator that occurs within a GROUP BY
clause.public static final SqlKind ROLLUP
ROLLUP operator that occurs within a GROUP BY
clause.public static final SqlKind GROUPING_SETS
GROUPING SETS operator that occurs within a
GROUP BY clause.public static final SqlKind GROUPING
GROUPING(e, ...) function.@Deprecated public static final SqlKind GROUPING_ID
GROUPING.public static final SqlKind GROUP_ID
GROUP_ID() function.public static final SqlKind PATTERN_PERMUTE
public static final SqlKind PATTERN_EXCLUDED
public static final SqlKind COUNT
COUNT aggregate function.public static final SqlKind SUM
SUM aggregate function.public static final SqlKind SUM0
SUM0 aggregate function.public static final SqlKind MIN
MIN aggregate function.public static final SqlKind MAX
MAX aggregate function.public static final SqlKind LEAD
LEAD aggregate function.public static final SqlKind LAG
LAG aggregate function.public static final SqlKind FIRST_VALUE
FIRST_VALUE aggregate function.public static final SqlKind LAST_VALUE
LAST_VALUE aggregate function.public static final SqlKind COVAR_POP
COVAR_POP aggregate function.public static final SqlKind COVAR_SAMP
COVAR_SAMP aggregate function.public static final SqlKind REGR_SXX
REGR_SXX aggregate function.public static final SqlKind REGR_SYY
REGR_SYY aggregate function.public static final SqlKind AVG
AVG aggregate function.public static final SqlKind STDDEV_POP
STDDEV_POP aggregate function.public static final SqlKind STDDEV_SAMP
STDDEV_SAMP aggregate function.public static final SqlKind VAR_POP
VAR_POP aggregate function.public static final SqlKind VAR_SAMP
VAR_SAMP aggregate function.public static final SqlKind NTILE
NTILE aggregate function.public static final SqlKind COLLECT
COLLECT aggregate function.public static final SqlKind FUSION
FUSION aggregate function.public static final SqlKind SINGLE_VALUE
SINGLE_VALUE aggregate function.public static final SqlKind ROW_NUMBER
ROW_NUMBER window function.public static final SqlKind RANK
RANK window function.public static final SqlKind PERCENT_RANK
PERCENT_RANK window function.public static final SqlKind DENSE_RANK
DENSE_RANK window function.public static final SqlKind CUME_DIST
ROW_NUMBER window function.public static final SqlKind TUMBLE
TUMBLE group function.public static final SqlKind TUMBLE_START
TUMBLE_START auxiliary function of
the TUMBLE group function.public static final SqlKind TUMBLE_END
TUMBLE_END auxiliary function of
the TUMBLE group function.public static final SqlKind HOP
HOP group function.public static final SqlKind HOP_START
HOP_START auxiliary function of
the HOP group function.public static final SqlKind HOP_END
HOP_END auxiliary function of
the HOP group function.public static final SqlKind SESSION
SESSION group function.public static final SqlKind SESSION_START
SESSION_START auxiliary function of
the SESSION group function.public static final SqlKind SESSION_END
SESSION_END auxiliary function of
the SESSION group function.public static final SqlKind COLUMN_DECL
public static final SqlKind CHECK
CHECK constraint.public static final SqlKind UNIQUE
UNIQUE constraint.public static final SqlKind PRIMARY_KEY
PRIMARY KEY constraint.public static final SqlKind FOREIGN_KEY
FOREIGN KEY constraint.public static final SqlKind COMMIT
COMMIT session control statement.public static final SqlKind ROLLBACK
ROLLBACK session control statement.public static final SqlKind ALTER_SESSION
ALTER SESSION DDL statement.public static final SqlKind CREATE_SCHEMA
CREATE SCHEMA DDL statement.public static final SqlKind CREATE_FOREIGN_SCHEMA
CREATE FOREIGN SCHEMA DDL statement.public static final SqlKind DROP_SCHEMA
DROP SCHEMA DDL statement.public static final SqlKind CREATE_TABLE
CREATE TABLE DDL statement.public static final SqlKind ALTER_TABLE
ALTER TABLE DDL statement.public static final SqlKind DROP_TABLE
DROP TABLE DDL statement.public static final SqlKind CREATE_VIEW
CREATE VIEW DDL statement.public static final SqlKind ALTER_VIEW
ALTER VIEW DDL statement.public static final SqlKind DROP_VIEW
DROP VIEW DDL statement.public static final SqlKind CREATE_MATERIALIZED_VIEW
CREATE MATERIALIZED VIEW DDL statement.public static final SqlKind ALTER_MATERIALIZED_VIEW
ALTER MATERIALIZED VIEW DDL statement.public static final SqlKind DROP_MATERIALIZED_VIEW
DROP MATERIALIZED VIEW DDL statement.public static final SqlKind CREATE_SEQUENCE
CREATE SEQUENCE DDL statement.public static final SqlKind ALTER_SEQUENCE
ALTER SEQUENCE DDL statement.public static final SqlKind DROP_SEQUENCE
DROP SEQUENCE DDL statement.public static final SqlKind CREATE_INDEX
CREATE INDEX DDL statement.public static final SqlKind ALTER_INDEX
ALTER INDEX DDL statement.public static final SqlKind DROP_INDEX
DROP INDEX DDL statement.public static final SqlKind OTHER_DDL
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!
public static final EnumSet<SqlKind> AGGREGATE
public static final EnumSet<SqlKind> DML
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.
public static final Set<SqlKind> EXPRESSION
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.
public static final Set<SqlKind> FUNCTION
Consists of regular functions OTHER_FUNCTION and special
functions ROW, TRIM, CAST, JDBC_FN.
public static final Set<SqlKind> AVG_AGG_FUNCTIONS
Consists of AVG, STDDEV_POP, STDDEV_SAMP,
VAR_POP, VAR_SAMP.
public static final Set<SqlKind> COMPARISON
Consists of:
IN,
EQUALS,
NOT_EQUALS,
LESS_THAN,
GREATER_THAN,
LESS_THAN_OR_EQUAL,
GREATER_THAN_OR_EQUAL.
public final String lowerName
public final String sql
public static SqlKind[] values()
for (SqlKind c : SqlKind.values()) System.out.println(c);
public static SqlKind valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic SqlKind reverse()
For example, GREATER_THAN.reverse() returns LESS_THAN.
public SqlKind negate()
For example, IS_NOT_NULL.negate() returns IS_NULL.
For IS_TRUE, IS_FALSE, IS_NOT_TRUE,
IS_NOT_FALSE, nullable inputs need to be treated carefully.
NOT(IS_TRUE(null)) = NOT(false) = true,
while IS_FALSE(null) = false,
so NOT(IS_TRUE(X)) should be IS_NOT_TRUE(X).
On the other hand,
IS_TRUE(NOT(null)) = IS_TRUE(null) = false.
This is why negate() != negateNullSafe() for these operators.
public SqlKind negateNullSafe()
For IS_TRUE, IS_FALSE, IS_NOT_TRUE and
IS_NOT_FALSE, nullable inputs need to be treated carefully:
public final boolean belongsTo(Collection<SqlKind> category)
SqlKind belongs to a given category.
A category is a collection of kinds, not necessarily disjoint. For example, QUERY is { SELECT, UNION, INTERSECT, EXCEPT, VALUES, ORDER_BY, EXPLICIT_TABLE }.
category - Category@SafeVarargs private static <E extends Enum<E>> EnumSet<E> concat(EnumSet<E> set0, EnumSet<E>... sets)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.