Class SqlLibraryOperatorTableFactory

java.lang.Object
org.apache.calcite.sql.fun.SqlLibraryOperatorTableFactory

public class SqlLibraryOperatorTableFactory extends Object
Factory that creates operator tables that consist of functions and operators for particular named libraries. For example, the following code will return an operator table that contains operators for both Oracle and MySQL:
SqlOperatorTable opTab =
     SqlLibraryOperatorTableFactory.INSTANCE.getOperatorTable(
         EnumSet.of(SqlLibrary.ORACLE, SqlLibrary.MYSQL))

To define a new library, add a value to enum SqlLibrary.

To add functions to a library, add the LibraryOperator annotation to fields that of type SqlOperator, and the library name to its LibraryOperator.libraries() field.

  • Field Details

  • Method Details

    • getOperatorTable

      public SqlOperatorTable getOperatorTable(SqlLibrary... libraries)
      Returns a SQL operator table that contains operators in the given library or libraries.
    • getOperatorTable

      public SqlOperatorTable getOperatorTable(Iterable<SqlLibrary> librarySet)
      Returns a SQL operator table that contains operators in the given set of libraries.
    • getOperatorTable

      public SqlOperatorTable getOperatorTable(Iterable<SqlLibrary> librarySet, boolean includeAll)
      Returns a SQL operator table that contains operators in the given set of libraries, optionally inheriting in operators in SqlLibrary.ALL.