Enum SqlWriter.FrameTypeEnum

java.lang.Object
java.lang.Enum<SqlWriter.FrameTypeEnum>
org.apache.calcite.sql.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.
  • Enum Constant Details

    • 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.
    • PARENTHESES

      public static final SqlWriter.FrameTypeEnum PARENTHESES
      Comma-separated list surrounded by parentheses. The parentheses are present even if the list is empty.
    • 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.
    • WITH_BODY

      public static final SqlWriter.FrameTypeEnum WITH_BODY
      The body query of WITH.
    • 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"
    • AS

      public static final SqlWriter.FrameTypeEnum AS
      Alias ("AS"). No indent.
    • CASE

      public static final SqlWriter.FrameTypeEnum CASE
      CASE expression.
    • OTHER

      public static final SqlWriter.FrameTypeEnum OTHER
      Same behavior as user-defined frame type.
  • Method Details

    • values

      public static SqlWriter.FrameTypeEnum[] 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

      public static SqlWriter.FrameTypeEnum valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      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 interface SqlWriter.FrameType
      Returns:
      whether to further indent code within a frame of this type
    • create

      public static SqlWriter.FrameType create(String name)
      Creates a frame type.
      Parameters:
      name - Name
      Returns:
      frame type
    • getName

      public String getName()
      Description copied from interface: SqlWriter.FrameType
      Returns the name of this frame type.
      Specified by:
      getName in interface SqlWriter.FrameType
      Returns:
      name