Package org.apache.calcite.sql.type
Interface SqlReturnTypeInference
- All Known Implementing Classes:
CursorReturnTypeInference
,ExplicitReturnTypeInference
,MatchReturnTypeInference
,OrdinalReturnTypeInference
,SqlReturnTypeInferenceChain
,SqlTypeTransformCascade
,TableFunctionReturnTypeInference
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface to infer the type of an operator call from the type of the
operands.
This interface is an example of the
strategy pattern
.
This makes
sense because many operators have similar, straightforward strategies, such
as to take the type of the first operand.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault SqlReturnTypeInference
andThen
(SqlTypeTransform transform) Returns a return-type inference that applies this rule then a transform.@Nullable RelDataType
inferReturnType
(SqlOperatorBinding opBinding) Infers the return type of a call to anSqlOperator
.default SqlReturnTypeInference
orElse
(SqlReturnTypeInference transform) Returns a return-type inference that applies this rule then another rule, until one of them returns a not-null result.
-
Method Details
-
inferReturnType
Infers the return type of a call to anSqlOperator
.- Parameters:
opBinding
- description of operator binding- Returns:
- inferred type; may be null
-
andThen
Returns a return-type inference that applies this rule then a transform. -
orElse
Returns a return-type inference that applies this rule then another rule, until one of them returns a not-null result.
-