Package org.apache.calcite.sql.util
Class ReflectiveSqlOperatorTable
- java.lang.Object
-
- org.apache.calcite.sql.util.ReflectiveSqlOperatorTable
-
- All Implemented Interfaces:
SqlOperatorTable
- Direct Known Subclasses:
OracleSqlOperatorTable
,SqlStdOperatorTable
public abstract class ReflectiveSqlOperatorTable extends java.lang.Object implements SqlOperatorTable
ReflectiveSqlOperatorTable implements theSqlOperatorTable
interface by reflecting the public fields of a subclass.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ReflectiveSqlOperatorTable.Key
Key for looking up operators.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
IS_NAME
private com.google.common.collect.Multimap<ReflectiveSqlOperatorTable.Key,SqlOperator>
operators
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReflectiveSqlOperatorTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SqlOperator>
getOperatorList()
Retrieves a list of all functions and operators in this table.void
init()
Performs post-constructor initialization of an operator 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.void
register(SqlOperator op)
Registers a function or operator in the table.
-
-
-
Field Detail
-
IS_NAME
public static final java.lang.String IS_NAME
- See Also:
- Constant Field Values
-
operators
private final com.google.common.collect.Multimap<ReflectiveSqlOperatorTable.Key,SqlOperator> operators
-
-
Method Detail
-
init
public final void init()
Performs post-constructor initialization of an operator table. It can't be part of the constructor, because the subclass constructor needs to complete first.
-
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
-
register
public void register(SqlOperator op)
Registers a function or operator in the table.
-
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
-
-