Annotation Type LibraryOperator


@Retention(RUNTIME) @Target(FIELD) public @interface LibraryOperator
An annotation that is read by SqlLibraryOperatorTableFactory to add functions and operators to a library.

Typically, such collections are associated with a particular dialect or database. For example, SqlLibrary.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.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The set of libraries that this function or operator belongs to.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The set of libraries that this function should be excluded from.
  • Element Details

    • libraries

      SqlLibrary[] libraries
      The set of libraries that this function or operator belongs to. Must not be null or empty.
    • exceptLibraries

      SqlLibrary[] exceptLibraries
      The set of libraries that this function should be excluded from.

      Only needed when a library inherits functions from another library. For example, SqlLibrary.REDSHIFT inherits from SqlLibrary.POSTGRESQL, and therefore contains all of PostgreSQL's operators by default. The STARTS_WITH function is in BigQuery and PostgreSQL but not in Redshift and therefore has the annotation

      @LibraryOperator(libraries = {BIG_QUERY, POSTGRESQL},
         exceptLibraries = {REDSHIFT})
      Default:
      {}