Package org.apache.calcite.sql.util
Class ChainedSqlOperatorTable
- java.lang.Object
-
- org.apache.calcite.sql.util.ChainedSqlOperatorTable
-
- All Implemented Interfaces:
SqlOperatorTable
public class ChainedSqlOperatorTable extends java.lang.Object implements SqlOperatorTable
ChainedSqlOperatorTable implements theSqlOperatorTable
interface by chaining together any number of underlying operator table instances.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<SqlOperatorTable>
tableList
-
Constructor Summary
Constructors Constructor Description ChainedSqlOperatorTable(java.util.List<SqlOperatorTable> tableList)
Creates a table based on a given list.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(SqlOperatorTable table)
Adds an underlying table.java.util.List<SqlOperator>
getOperatorList()
Retrieves a list of all functions and operators in this table.void
lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax, java.util.List<SqlOperator> operatorList)
Retrieves a list of operators with a given name and syntax.static SqlOperatorTable
of(SqlOperatorTable... tables)
Creates aChainedSqlOperatorTable
.
-
-
-
Field Detail
-
tableList
protected final java.util.List<SqlOperatorTable> tableList
-
-
Constructor Detail
-
ChainedSqlOperatorTable
public ChainedSqlOperatorTable(java.util.List<SqlOperatorTable> tableList)
Creates a table based on a given list.
-
-
Method Detail
-
of
public static SqlOperatorTable of(SqlOperatorTable... tables)
Creates aChainedSqlOperatorTable
.
-
add
public void add(SqlOperatorTable table)
Adds an underlying table. The order in which tables are added is significant; tables added earlier have higher lookup precedence. A table is not added if it is already on the list.- Parameters:
table
- table to add
-
lookupOperatorOverloads
public void lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax, java.util.List<SqlOperator> operatorList)
Description copied from interface:SqlOperatorTable
Retrieves a list of operators with a given name and syntax. For example, by passing SqlSyntax.Function, the returned list is narrowed to only matching SqlFunction objects.- Specified by:
lookupOperatorOverloads
in interfaceSqlOperatorTable
- Parameters:
opName
- name of operatorcategory
- function category to look up, or null for any matching operatorsyntax
- syntax type of operatoroperatorList
- mutable list to which to append matches
-
getOperatorList
public java.util.List<SqlOperator> getOperatorList()
Description copied from interface:SqlOperatorTable
Retrieves a list of all functions and operators in this table. Used for automated testing.- Specified by:
getOperatorList
in interfaceSqlOperatorTable
- Returns:
- list of SqlOperator objects
-
-