-
- All Known Implementing Classes:
FixedType
,ObjectInputTyper
,WidestInputTyper
public interface FunctionTyper
Determines the upper bound and result type of aScalarValuedFunction
. A number of implementations are provided which cover common use cases.A
FunctionTyper
is used as part of a function description to provide type checking of arguments and to determine the type of the output buffer. Because descriptions are serialized within the framework, implementations ofFunctionTyper
must also be serializable as JSON.- See Also:
ScalarValuedFunction
,ScalarFunctionDescriptor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ScalarTokenType
computeResultType(FunctionContext ctx)
Calculates the result type for the function given the provided context.ScalarTokenType
computeUpperBound(FunctionContext ctx)
Calculates the upper bound for the function given the provided context.
-
-
-
Method Detail
-
computeUpperBound
ScalarTokenType computeUpperBound(FunctionContext ctx)
Calculates the upper bound for the function given the provided context.The context contains the upper bounds on the types of all arguments to the function. If a argument is not a subclass of
ScalarValuedFunction
, its type isnull
.- Parameters:
ctx
- the context of the function being processed- Returns:
- the upper bound on the function
-
computeResultType
ScalarTokenType computeResultType(FunctionContext ctx)
Calculates the result type for the function given the provided context.The context contains the actual result types of all arguments to the function. If a argument is not a subclass of
ScalarValuedFunction
, its type isnull
.- Parameters:
ctx
- the context of the function being processed- Returns:
- the result type of the function
-
-