Interface InputTypeStrategy
-
- All Known Implementing Classes:
CommonArrayInputTypeStrategy,CommonCollectionInputTypeStrategy,CommonInputTypeStrategy,CommonMapInputTypeStrategy,ComparableTypeStrategy,LeadLagInputTypeStrategy,OrInputTypeStrategy,OverTypeStrategy,ReinterpretCastInputTypeStrategy,RepeatingSequenceInputTypeStrategy,SequenceInputTypeStrategy,SubQueryInputTypeStrategy,SubsequenceInputTypeStrategy,VaryingSequenceInputTypeStrategy,WildcardInputTypeStrategy,WindowTimeIndictorInputTypeStrategy
@PublicEvolving public interface InputTypeStrategyStrategy for inferring and validating input arguments in a function call.This interface has three responsibilities during the
TypeInferenceprocess:It can help in resolving the type of untyped
NULLliterals.It validates the types of the input arguments.
During the planning process, it can help in resolving the complete
DataType, i.e., the conversion class that a function implementation expects from the runtime. This requires that a strategy can also be called on already validated arguments without affecting the logical type.Note: Implementations should implement
Object.hashCode()andObject.equals(Object).- See Also:
InputTypeStrategies
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ArgumentCountgetArgumentCount()Initial input validation based on the number of arguments.List<Signature>getExpectedSignatures(FunctionDefinition definition)Returns a summary of the function's expected signatures.Optional<List<DataType>>inferInputTypes(CallContext callContext, boolean throwOnFailure)Main logic for inferring and validating the input arguments.
-
-
-
Method Detail
-
getArgumentCount
ArgumentCount getArgumentCount()
Initial input validation based on the number of arguments.
-
inferInputTypes
Optional<List<DataType>> inferInputTypes(CallContext callContext, boolean throwOnFailure)
Main logic for inferring and validating the input arguments. Returns a list of argument data types that are valid for the given call. If the returned types differ fromCallContext.getArgumentDataTypes(), a casting operation can be inserted. An empty result means that the given input is invalid.- Parameters:
callContext- provides details about the function callthrowOnFailure- whether this function is allowed to throw anValidationExceptionwith a meaningful exception in case the inference is not successful or if this function should simply return an empty result.- Returns:
- three-state result for either "true, same data types as arguments", "true, but arguments must be casted to returned data types", or "false, no inferred data types could be found"
- See Also:
CallContext.newValidationError(String, Object...)
-
getExpectedSignatures
List<Signature> getExpectedSignatures(FunctionDefinition definition)
Returns a summary of the function's expected signatures.- Parameters:
definition- the function definition that defines the function currently being called.
-
-