Package org.apache.calcite.sql
Enum SqlWriter.FrameTypeEnum
- java.lang.Object
-
- java.lang.Enum<SqlWriter.FrameTypeEnum>
-
- org.apache.calcite.sql.SqlWriter.FrameTypeEnum
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<SqlWriter.FrameTypeEnum>
,SqlWriter.FrameType
- Enclosing interface:
- SqlWriter
public static enum SqlWriter.FrameTypeEnum extends java.lang.Enum<SqlWriter.FrameTypeEnum> implements SqlWriter.FrameType
Enumerates the types of frame.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FETCH
FETCH clause.FROM_LIST
FROM clause (containing various kinds of JOIN).FUN_CALL
Function call or datatype declaration.FUN_DECL
Function declaration.GROUP_BY_LIST
GROUP BY list.IDENTIFIER
Compound identifier.JOIN
Pair-wise join.OFFSET
OFFSET clause.ORDER_BY
ORDER BY clause of a SELECT statement.ORDER_BY_LIST
ORDER BY list.SELECT
SELECT query (or UPDATE or DELETE).SELECT_LIST
The SELECT clause of a SELECT statement.SETOP
Set operation.SIMPLE
Simple list.SUB_QUERY
Sub-query list.UPDATE_SET_LIST
The SET clause of an UPDATE statement.VALUES
VALUES clause.WHERE_LIST
WHERE clause.WINDOW
Window specification.WINDOW_DECL_LIST
The WINDOW clause of a SELECT statement.WITH
WITH clause of a SELECT statement.
-
Field Summary
Fields Modifier and Type Field Description private boolean
needsIndent
-
Constructor Summary
Constructors Modifier Constructor Description private
FrameTypeEnum()
Creates a list type.private
FrameTypeEnum(boolean needsIndent)
Creates a list type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SqlWriter.FrameType
create(java.lang.String name)
Creates a frame type.java.lang.String
getName()
Returns the name of this frame type.boolean
needsIndent()
Returns whether this frame type should cause the code be further indented.static SqlWriter.FrameTypeEnum
valueOf(java.lang.String name)
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 Detail
-
SELECT
public static final SqlWriter.FrameTypeEnum SELECT
SELECT query (or UPDATE or DELETE). The items in the list are the clauses: FROM, WHERE, etc.
-
SIMPLE
public static final SqlWriter.FrameTypeEnum SIMPLE
Simple list.
-
SELECT_LIST
public static final SqlWriter.FrameTypeEnum SELECT_LIST
The SELECT clause of a SELECT statement.
-
WINDOW_DECL_LIST
public static final SqlWriter.FrameTypeEnum WINDOW_DECL_LIST
The WINDOW clause of a SELECT statement.
-
UPDATE_SET_LIST
public static final SqlWriter.FrameTypeEnum UPDATE_SET_LIST
The SET clause of an UPDATE statement.
-
FUN_DECL
public static final SqlWriter.FrameTypeEnum FUN_DECL
Function declaration.
-
FUN_CALL
public static final SqlWriter.FrameTypeEnum FUN_CALL
Function call or datatype declaration.Examples:
SUBSTRING('foobar' FROM 1 + 2 TO 4)
DECIMAL(10, 5)
-
WINDOW
public static final SqlWriter.FrameTypeEnum 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
public static final SqlWriter.FrameTypeEnum 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
public static final SqlWriter.FrameTypeEnum ORDER_BY_LIST
ORDER BY list.Example:
ORDER BY x, y DESC, z
-
WITH
public static final SqlWriter.FrameTypeEnum WITH
WITH clause of a SELECT statement. The "list" has only two items: the WITH clause and the query, with AS as the separator.
-
OFFSET
public static final SqlWriter.FrameTypeEnum OFFSET
OFFSET clause.Example:
OFFSET 10 ROWS
-
FETCH
public static final SqlWriter.FrameTypeEnum FETCH
FETCH clause.Example:
FETCH FIRST 3 ROWS ONLY
-
GROUP_BY_LIST
public static final SqlWriter.FrameTypeEnum GROUP_BY_LIST
GROUP BY list.Example:
GROUP BY x, FLOOR(y)
-
SUB_QUERY
public static final SqlWriter.FrameTypeEnum SUB_QUERY
Sub-query list. Encloses a SELECT, UNION, EXCEPT, INTERSECT query with optional ORDER BY.Example:
GROUP BY x, FLOOR(y)
-
SETOP
public static final SqlWriter.FrameTypeEnum SETOP
Set operation.Example:
SELECT * FROM a UNION SELECT * FROM b
-
VALUES
public static final SqlWriter.FrameTypeEnum VALUES
VALUES clause.Example:
VALUES (1, 'a'), (2, 'b')
-
FROM_LIST
public static final SqlWriter.FrameTypeEnum FROM_LIST
FROM clause (containing various kinds of JOIN).
-
JOIN
public static final SqlWriter.FrameTypeEnum JOIN
Pair-wise join.
-
WHERE_LIST
public static final SqlWriter.FrameTypeEnum WHERE_LIST
WHERE clause.
-
IDENTIFIER
public static final SqlWriter.FrameTypeEnum IDENTIFIER
Compound identifier.Example:
"A"."B"."C"
-
-
Method Detail
-
values
public static SqlWriter.FrameTypeEnum[] 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 (SqlWriter.FrameTypeEnum c : SqlWriter.FrameTypeEnum.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SqlWriter.FrameTypeEnum 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
-
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
public static SqlWriter.FrameType create(java.lang.String name)
Creates a frame type.- Parameters:
name
- Name- Returns:
- frame type
-
getName
public java.lang.String getName()
Description copied from interface:SqlWriter.FrameType
Returns the name of this frame type.- Specified by:
getName
in interfaceSqlWriter.FrameType
- Returns:
- name
-
-