Enum SqlSyntax

java.lang.Object
java.lang.Enum<SqlSyntax>
org.apache.calcite.sql.SqlSyntax
All Implemented Interfaces:
Serializable, Comparable<SqlSyntax>, java.lang.constant.Constable

public enum SqlSyntax extends Enum<SqlSyntax>
Enumeration of possible syntactic types of operators.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Binary operator syntax, as in "x + y".
    Function syntax, as in "Foo(x, y)".
    Function syntax which takes no parentheses if there are no arguments, for example "CURRENTTIME".
    Function syntax, as in "Foo(x, y)", but uses "*" if there are no arguments, for example "COUNT(*)".
    Syntax of an internal operator, which does not appear in the SQL.
    Function syntax with optional ORDER BY, as in "STRING_AGG(x, y ORDER BY z)".
    Postfix unary operator syntax, as in "x ++".
    Prefix unary operator syntax, as in "- x".
    Special syntax, such as that of the SQL CASE operator, "CASE x WHEN 1 THEN 2 ELSE 3 END".
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final SqlSyntax
    Syntax to treat this syntax as equivalent to when resolving operators.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    unparse(SqlWriter writer, SqlOperator operator, SqlCall call, int leftPrec, int rightPrec)
    Converts a call to an operator of this syntax into a string.
    static SqlSyntax
    Returns the enum constant of this type with the specified name.
    static SqlSyntax[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FUNCTION

      public static final SqlSyntax FUNCTION
      Function syntax, as in "Foo(x, y)".
    • FUNCTION_STAR

      public static final SqlSyntax FUNCTION_STAR
      Function syntax, as in "Foo(x, y)", but uses "*" if there are no arguments, for example "COUNT(*)".
    • ORDERED_FUNCTION

      public static final SqlSyntax ORDERED_FUNCTION
      Function syntax with optional ORDER BY, as in "STRING_AGG(x, y ORDER BY z)".
    • BINARY

      public static final SqlSyntax BINARY
      Binary operator syntax, as in "x + y".
    • PREFIX

      public static final SqlSyntax PREFIX
      Prefix unary operator syntax, as in "- x".
    • POSTFIX

      public static final SqlSyntax POSTFIX
      Postfix unary operator syntax, as in "x ++".
    • SPECIAL

      public static final SqlSyntax SPECIAL
      Special syntax, such as that of the SQL CASE operator, "CASE x WHEN 1 THEN 2 ELSE 3 END".
    • FUNCTION_ID

      public static final SqlSyntax FUNCTION_ID
      Function syntax which takes no parentheses if there are no arguments, for example "CURRENTTIME".
      See Also:
    • INTERNAL

      public static final SqlSyntax INTERNAL
      Syntax of an internal operator, which does not appear in the SQL.
  • Field Details

    • family

      @NotOnlyInitialized public final SqlSyntax family
      Syntax to treat this syntax as equivalent to when resolving operators.
  • Method Details

    • values

      public static SqlSyntax[] 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 SqlSyntax 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
    • unparse

      public abstract void unparse(SqlWriter writer, SqlOperator operator, SqlCall call, int leftPrec, int rightPrec)
      Converts a call to an operator of this syntax into a string.