Package org.apache.calcite.sql2rel
Class ReflectiveConvertletTable
- java.lang.Object
-
- org.apache.calcite.sql2rel.ReflectiveConvertletTable
-
- All Implemented Interfaces:
SqlRexConvertletTable
- Direct Known Subclasses:
StandardConvertletTable
public class ReflectiveConvertletTable extends java.lang.Object implements SqlRexConvertletTable
Implementation ofSqlRexConvertletTable
which uses reflection to call any method of the formpublic RexNode convertXxx(ConvertletContext, SqlNode)
orpublic RexNode convertXxx(ConvertletContext, SqlOperator, SqlCall)
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.Object,java.lang.Object>
map
-
Constructor Summary
Constructors Constructor Description ReflectiveConvertletTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAlias(SqlOperator alias, SqlOperator target)
Registers that one operator is an alias for another.SqlRexConvertlet
get(SqlCall call)
Returns the convertlet applicable to a given expression.private void
registerNodeTypeMethod(java.lang.reflect.Method method)
Registers method if it: a.protected void
registerOp(SqlOperator op, SqlRexConvertlet convertlet)
Registers a convertlet for a given operator instanceprivate void
registerOpTypeMethod(java.lang.reflect.Method method)
Registers method if it: a.
-
-
-
Method Detail
-
registerNodeTypeMethod
private void registerNodeTypeMethod(java.lang.reflect.Method method)
Registers method if it: a. is public, and b. is named "convertXxx", and c. has a return type of "RexNode" or a subtype d. has a 2 parameters with types ConvertletContext and SqlNode (or a subtype) respectively.
-
registerOpTypeMethod
private void registerOpTypeMethod(java.lang.reflect.Method method)
Registers method if it: a. is public, and b. is named "convertXxx", and c. has a return type of "RexNode" or a subtype d. has a 3 parameters with types: ConvertletContext; SqlOperator (or a subtype), SqlCall (or a subtype).
-
get
public SqlRexConvertlet get(SqlCall call)
Description copied from interface:SqlRexConvertletTable
Returns the convertlet applicable to a given expression.- Specified by:
get
in interfaceSqlRexConvertletTable
-
registerOp
protected void registerOp(SqlOperator op, SqlRexConvertlet convertlet)
Registers a convertlet for a given operator instance- Parameters:
op
- Operator instance, saySqlStdOperatorTable.MINUS
convertlet
- Convertlet
-
addAlias
protected void addAlias(SqlOperator alias, SqlOperator target)
Registers that one operator is an alias for another.- Parameters:
alias
- Operator which is aliastarget
- Operator to translate calls to
-
-