Package org.apache.calcite.sql.type
Class SqlReturnTypeInferenceChain
- java.lang.Object
-
- org.apache.calcite.sql.type.SqlReturnTypeInferenceChain
-
- All Implemented Interfaces:
SqlReturnTypeInference
public class SqlReturnTypeInferenceChain extends java.lang.Object implements SqlReturnTypeInference
Strategy to infer the type of an operator call from the type of the operands by using a series ofSqlReturnTypeInference
rules in a given order. If a rule fails to find a return type (by returning NULL), next rule is tried until there are no more rules in which case NULL will be returned.
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<SqlReturnTypeInference>
rules
-
Constructor Summary
Constructors Constructor Description SqlReturnTypeInferenceChain(SqlReturnTypeInference... rules)
Creates a SqlReturnTypeInferenceChain from an array of rules.
-
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
-
rules
private final com.google.common.collect.ImmutableList<SqlReturnTypeInference> rules
-
-
Constructor Detail
-
SqlReturnTypeInferenceChain
SqlReturnTypeInferenceChain(SqlReturnTypeInference... rules)
Creates a SqlReturnTypeInferenceChain from an array of rules.Package-protected. Use
ReturnTypes.chain(org.apache.calcite.sql.type.SqlReturnTypeInference...)
.
-
-
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
-
-