Package org.apache.calcite.sql.type
Class ExplicitReturnTypeInference
- java.lang.Object
-
- org.apache.calcite.sql.type.ExplicitReturnTypeInference
-
- All Implemented Interfaces:
SqlReturnTypeInference
- Direct Known Subclasses:
TableFunctionReturnTypeInference
public class ExplicitReturnTypeInference extends java.lang.Object implements SqlReturnTypeInference
ASqlReturnTypeInference
which always returns the same SQL type.
-
-
Field Summary
Fields Modifier and Type Field Description protected RelProtoDataType
protoType
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExplicitReturnTypeInference(RelProtoDataType protoType)
Creates an inference rule which always returns the same type object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelDataType
inferReturnType(SqlOperatorBinding opBinding)
Infers the return type of a call to anSqlOperator
.
-
-
-
Field Detail
-
protoType
protected final RelProtoDataType protoType
-
-
Constructor Detail
-
ExplicitReturnTypeInference
protected ExplicitReturnTypeInference(RelProtoDataType protoType)
Creates an inference rule which always returns the same type object.If the requesting type factory is different, returns a copy of the type object made using
RelDataTypeFactory.copyType(RelDataType)
within the requesting type factory.A copy of the type is required because each statement is prepared using a different type factory; each type factory maintains its own cache of canonical instances of each type.
- Parameters:
protoType
- Type object
-
-
Method Detail
-
inferReturnType
public RelDataType inferReturnType(SqlOperatorBinding opBinding)
Description copied from interface:SqlReturnTypeInference
Infers the return type of a call to anSqlOperator
.- Specified by:
inferReturnType
in interfaceSqlReturnTypeInference
- Parameters:
opBinding
- description of operator binding- Returns:
- inferred type; may be null
-
-