Package org.apache.calcite.sql
Enum SqlWriter.FrameTypeEnum
- All Implemented Interfaces:
Serializable
,Comparable<SqlWriter.FrameTypeEnum>
,Constable
,SqlWriter.FrameType
- Enclosing interface:
SqlWriter
public static enum SqlWriter.FrameTypeEnum
extends Enum<SqlWriter.FrameTypeEnum>
implements SqlWriter.FrameType
Enumerates the types of frame.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAlias ("AS").CASE expression.FETCH clause.FROM clause (containing various kinds of JOIN).Function call or datatype declaration.Function declaration.GROUP BY list.Compound identifier.Pair-wise join.OFFSET clause.ORDER BY clause of a SELECT statement.ORDER BY list.Same behavior as user-defined frame type.Comma-separated list surrounded by parentheses.SELECT query (or UPDATE or DELETE).The SELECT clause of a SELECT statement.Set operation.Simple list.Sub-query list.The SET clause of an UPDATE statement.VALUES clause.WHERE clause.Window specification.The WINDOW clause of a SELECT statement.WITH clause of a SELECT statement.The body query of WITH. -
Method Summary
Modifier and TypeMethodDescriptionstatic SqlWriter.FrameType
Creates a frame type.getName()
Returns the name of this frame type.boolean
Returns whether this frame type should cause the code be further indented.static SqlWriter.FrameTypeEnum
Returns the enum constant of this type with the specified name.static SqlWriter.FrameTypeEnum[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SELECT
SELECT query (or UPDATE or DELETE). The items in the list are the clauses: FROM, WHERE, etc. -
SIMPLE
Simple list. -
PARENTHESES
Comma-separated list surrounded by parentheses. The parentheses are present even if the list is empty. -
SELECT_LIST
The SELECT clause of a SELECT statement. -
WINDOW_DECL_LIST
The WINDOW clause of a SELECT statement. -
UPDATE_SET_LIST
The SET clause of an UPDATE statement. -
FUN_DECL
Function declaration. -
FUN_CALL
Function call or datatype declaration.Examples:
SUBSTRING('foobar' FROM 1 + 2 TO 4)
DECIMAL(10, 5)
-
WINDOW
Window specification.Examples:
SUM(x) OVER (ORDER BY hireDate ROWS 3 PRECEDING)
WINDOW w1 AS (ORDER BY hireDate), w2 AS (w1 PARTITION BY gender RANGE BETWEEN INTERVAL '1' YEAR PRECEDING AND '2' MONTH PRECEDING)
-
ORDER_BY
ORDER BY clause of a SELECT statement. The "list" has only two items: the query and the order by clause, with ORDER BY as the separator. -
ORDER_BY_LIST
ORDER BY list.Example:
ORDER BY x, y DESC, z
-
WITH
WITH clause of a SELECT statement. The "list" has only two items: the WITH clause and the query, with AS as the separator. -
WITH_BODY
The body query of WITH. -
OFFSET
OFFSET clause.Example:
OFFSET 10 ROWS
-
FETCH
FETCH clause.Example:
FETCH FIRST 3 ROWS ONLY
-
GROUP_BY_LIST
GROUP BY list.Example:
GROUP BY x, FLOOR(y)
-
SUB_QUERY
Sub-query list. Encloses a SELECT, UNION, EXCEPT, INTERSECT query with optional ORDER BY.Example:
GROUP BY x, FLOOR(y)
-
SETOP
Set operation.Example:
SELECT * FROM a UNION SELECT * FROM b
-
VALUES
VALUES clause.Example:
VALUES (1, 'a'), (2, 'b')
-
FROM_LIST
FROM clause (containing various kinds of JOIN). -
JOIN
Pair-wise join. -
WHERE_LIST
WHERE clause. -
IDENTIFIER
Compound identifier.Example:
"A"."B"."C"
-
AS
Alias ("AS"). No indent. -
CASE
CASE expression. -
OTHER
Same behavior as user-defined frame type.
-
-
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
-
needsIndent
public boolean needsIndent()Description copied from interface:SqlWriter.FrameType
Returns whether this frame type should cause the code be further indented.- Specified by:
needsIndent
in interfaceSqlWriter.FrameType
- Returns:
- whether to further indent code within a frame of this type
-
create
Creates a frame type.- Parameters:
name
- Name- Returns:
- frame type
-
getName
Description copied from interface:SqlWriter.FrameType
Returns the name of this frame type.- Specified by:
getName
in interfaceSqlWriter.FrameType
- Returns:
- name
-