Package org.apache.calcite.sql.util
Class ListSqlOperatorTable
java.lang.Object
org.apache.calcite.sql.util.ListSqlOperatorTable
- All Implemented Interfaces:
- SqlOperatorTable
Implementation of the 
SqlOperatorTable interface by using a list of
 operators.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected com.google.common.collect.ImmutableMultimap<String,SqlOperator> Contains all (name, operator) pairs.
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.ListSqlOperatorTable(List<SqlOperator> operatorList) Deprecated.UseSqlOperatorTables.of(java.lang.Iterable<? extends org.apache.calcite.sql.SqlOperator>), which creates an immutable table.
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(SqlOperator op) Deprecated.UseSqlOperatorTables.of(java.lang.Iterable<? extends org.apache.calcite.sql.SqlOperator>), which creates an immutable table.protected static com.google.common.collect.ImmutableMultimap<String,SqlOperator> buildIndex(Iterable<? extends SqlOperator> operators) Derives a value to be assigned tooperatorsfrom a given list of operators.protected static SqlFunctionCategorycategory(SqlOperator operator) Retrieves a list of all functions and operators in this table.voidlookupOperatorOverloads(SqlIdentifier opName, @Nullable SqlFunctionCategory category, SqlSyntax syntax, List<SqlOperator> operatorList, SqlNameMatcher nameMatcher) Retrieves a list of operators with a given name and syntax.protected voidlookUpOperators(String name, boolean caseSensitive, Consumer<SqlOperator> consumer) Looks up operators, optionally matching case-sensitively.protected voidsetOperators(com.google.common.collect.Multimap<String, SqlOperator> operators) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.sql.SqlOperatorTablegetOperatorList
- 
Field Details- 
operatorsContains all (name, operator) pairs. Effectively a sorted immutable multimap.There can be several operators with the same name (case-insensitive or case-sensitive) and these operators will lie in a contiguous range which we can find efficiently using binary search. 
 
- 
- 
Constructor Details- 
ListSqlOperatorTableDeprecated.UseSqlOperatorTables.of(java.lang.Iterable<? extends org.apache.calcite.sql.SqlOperator>), which creates an immutable table.Creates an empty, mutable ListSqlOperatorTable.
- 
ListSqlOperatorTableDeprecated.UseSqlOperatorTables.of(java.lang.Iterable<? extends org.apache.calcite.sql.SqlOperator>), which creates an immutable table.Creates a mutable ListSqlOperatorTable backed by a given list.
 
- 
- 
Method Details- 
addDeprecated.UseSqlOperatorTables.of(java.lang.Iterable<? extends org.apache.calcite.sql.SqlOperator>), which creates an immutable table.Adds an operator to this table.
- 
lookupOperatorOverloadspublic void lookupOperatorOverloads(SqlIdentifier opName, @Nullable SqlFunctionCategory category, SqlSyntax syntax, List<SqlOperator> operatorList, SqlNameMatcher nameMatcher) Description copied from interface:SqlOperatorTableRetrieves 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:
- lookupOperatorOverloadsin interface- SqlOperatorTable
- Parameters:
- opName- name of operator
- category- function category to look up, or null for any matching operator
- syntax- syntax type of operator
- operatorList- mutable list to which to append matches
- nameMatcher- Name matcher
 
- 
category
- 
getOperatorListDescription copied from interface:SqlOperatorTableRetrieves a list of all functions and operators in this table. Used for automated testing. Depending on the table type, may or may not be mutable.- Specified by:
- getOperatorListin interface- SqlOperatorTable
- Returns:
- list of SqlOperator objects
 
- 
setOperators
- 
buildIndexprotected static com.google.common.collect.ImmutableMultimap<String,SqlOperator> buildIndex(Iterable<? extends SqlOperator> operators) Derives a value to be assigned tooperatorsfrom a given list of operators.
- 
lookUpOperatorsLooks up operators, optionally matching case-sensitively.
 
- 
SqlOperatorTables.of(java.lang.Iterable<? extends org.apache.calcite.sql.SqlOperator>), which creates an immutable table.