Package org.apache.calcite.sql.type
Class MatchReturnTypeInference
- java.lang.Object
-
- org.apache.calcite.sql.type.MatchReturnTypeInference
-
- All Implemented Interfaces:
SqlReturnTypeInference
public class MatchReturnTypeInference extends java.lang.Object implements SqlReturnTypeInference
Returns the first type that matches a set of givenSqlTypeName
s. If no match could be found, null is returned.
-
-
Field Summary
Fields Modifier and Type Field Description private int
start
private java.util.List<SqlTypeName>
typeNames
-
Constructor Summary
Constructors Constructor Description MatchReturnTypeInference(int start, java.lang.Iterable<SqlTypeName> typeNames)
Returns the first type matching any type in typeNames at or after position start (zero based).MatchReturnTypeInference(int start, SqlTypeName... typeNames)
Returns the first type of typeName at or after position start (zero based).
-
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
-
start
private final int start
-
typeNames
private final java.util.List<SqlTypeName> typeNames
-
-
Constructor Detail
-
MatchReturnTypeInference
public MatchReturnTypeInference(int start, SqlTypeName... typeNames)
Returns the first type of typeName at or after position start (zero based).
-
MatchReturnTypeInference
public MatchReturnTypeInference(int start, java.lang.Iterable<SqlTypeName> typeNames)
Returns the first type matching any type in typeNames at or after position start (zero based).
-
-
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
-
-