Class SubsequenceInputTypeStrategy
- java.lang.Object
-
- org.apache.flink.table.types.inference.strategies.SubsequenceInputTypeStrategy
-
- All Implemented Interfaces:
InputTypeStrategy
@Internal public final class SubsequenceInputTypeStrategy extends Object implements InputTypeStrategy
AnInputTypeStrategythat lets you apply other strategies for subsequences of the actual arguments.The
SequenceInputTypeStrategyshould be preferred in most of the cases. Use this strategy only if you need to apply a common logic to a subsequence of the arguments.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSubsequenceInputTypeStrategy.SubsequenceStrategyBuilderA Builder forSubsequenceInputTypeStrategy.
-
Method Summary
All Methods Instance Methods Concrete 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
public ArgumentCount getArgumentCount()
Description copied from interface:InputTypeStrategyInitial input validation based on the number of arguments.- Specified by:
getArgumentCountin interfaceInputTypeStrategy
-
inferInputTypes
public Optional<List<DataType>> inferInputTypes(CallContext callContext, boolean throwOnFailure)
Description copied from interface:InputTypeStrategyMain 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.- Specified by:
inferInputTypesin interfaceInputTypeStrategy- 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
public List<Signature> getExpectedSignatures(FunctionDefinition definition)
Description copied from interface:InputTypeStrategyReturns a summary of the function's expected signatures.- Specified by:
getExpectedSignaturesin interfaceInputTypeStrategy- Parameters:
definition- the function definition that defines the function currently being called.
-
-