Enum SqlLibrary

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

public enum SqlLibrary extends Enum<SqlLibrary>
A library is a collection of SQL functions and operators.

Typically, such collections are associated with a particular dialect or database. For example, ORACLE is a collection of functions that are in the Oracle database but not the SQL standard.

In SqlLibraryOperatorTableFactory this annotation is applied to function definitions to include them in a particular library. It allows an operator to belong to more than one library.

See Also:
  • Enum Constant Details

    • STANDARD

      public static final SqlLibrary STANDARD
      The standard operators.
    • SPATIAL

      public static final SqlLibrary SPATIAL
      Geospatial operators.
    • ALL

      public static final SqlLibrary ALL
      A collection of operators that could be used in all libraries; does not include STANDARD and SPATIAL.
    • BIG_QUERY

      public static final SqlLibrary BIG_QUERY
      A collection of operators that are in Google BigQuery but not in standard SQL.
    • CALCITE

      public static final SqlLibrary CALCITE
      Calcite-specific extensions.
    • HIVE

      public static final SqlLibrary HIVE
      A collection of operators that are in Apache Hive but not in standard SQL.
    • MSSQL

      public static final SqlLibrary MSSQL
      A collection of operators that are in Microsoft SQL Server (MSSql) but not in standard SQL.
    • MYSQL

      public static final SqlLibrary MYSQL
      A collection of operators that are in MySQL but not in standard SQL.
    • ORACLE

      public static final SqlLibrary ORACLE
      A collection of operators that are in Oracle but not in standard SQL.
    • POSTGRESQL

      public static final SqlLibrary POSTGRESQL
      A collection of operators that are in PostgreSQL but not in standard SQL.
    • REDSHIFT

      public static final SqlLibrary REDSHIFT
      A collection of operators that are in Redshift but not in standard SQL or PostgreSQL.
    • SNOWFLAKE

      public static final SqlLibrary SNOWFLAKE
      A collection of operators that are in Snowflake but not in standard SQL.
    • SPARK

      public static final SqlLibrary SPARK
      A collection of operators that are in Apache Spark but not in standard SQL.
  • Field Details

    • MAP

      public static final Map<String,SqlLibrary> MAP
      Map from name and fun to library.
    • abbrev

      public final String abbrev
      Abbreviation for the library used in SQL reference.
    • fun

      public final String fun
      Name of this library when it appears in the connect string; see CalciteConnectionProperty.FUN.
    • parent

      public final @Nullable SqlLibrary parent
      The current library will by default inherit functions from parent.
  • Method Details

    • values

      public static SqlLibrary[] 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 SqlLibrary 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
    • children

      public List<SqlLibrary> children()
    • inheritors

      public Set<SqlLibrary> inheritors()
      Returns the libraries that inherit this library's functions, because their parent field points to this.

      For example, REDSHIFT inherits from POSTGRESQL. Never returns null.

    • of

      public static @Nullable SqlLibrary of(String name)
      Looks up a value. Returns null if not found. You can use upper- or lower-case name.
    • parse

      public static List<SqlLibrary> parse(String libraryNameList)
      Parses a comma-separated string such as "standard,oracle".
    • expand

      public static List<SqlLibrary> expand(Iterable<? extends SqlLibrary> libraries)
      Expands libraries in place.

      Preserves order, and ensures that no library occurs more than once.

    • expandUp

      public static List<SqlLibrary> expandUp(Iterable<? extends SqlLibrary> libraries)
      Expands libraries in place. If any library is a child of 'all', ensures that 'all' is in the list.