Package org.apache.calcite.sql.fun
Class SqlLibraryOperatorTableFactory
java.lang.Object
org.apache.calcite.sql.fun.SqlLibraryOperatorTableFactory
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 Summary
Modifier and TypeFieldDescriptionstatic final SqlLibraryOperatorTableFactory
The singleton instance. -
Method Summary
Modifier and TypeMethodDescriptiongetOperatorTable
(Iterable<SqlLibrary> librarySet) Returns a SQL operator table that contains operators in the given set of libraries.getOperatorTable
(Iterable<SqlLibrary> librarySet, boolean includeAll) Returns a SQL operator table that contains operators in the given set of libraries, optionally inheriting in operators inSqlLibrary.ALL
.getOperatorTable
(SqlLibrary... libraries) Returns a SQL operator table that contains operators in the given library or libraries.
-
Field Details
-
INSTANCE
The singleton instance.
-
-
Method Details
-
getOperatorTable
Returns a SQL operator table that contains operators in the given library or libraries. -
getOperatorTable
Returns a SQL operator table that contains operators in the given set of libraries. -
getOperatorTable
Returns a SQL operator table that contains operators in the given set of libraries, optionally inheriting in operators inSqlLibrary.ALL
.
-