Class ArrayComparableElementArgumentTypeStrategy
java.lang.Object
org.apache.flink.table.types.inference.strategies.ArrayComparableElementArgumentTypeStrategy
- All Implemented Interfaces:
ArgumentTypeStrategy
@Internal
public final class ArrayComparableElementArgumentTypeStrategy
extends Object
implements ArgumentTypeStrategy
An
ArgumentTypeStrategy that checks if the input argument is an ARRAY type and check
whether its' elements are comparable.
It requires one argument.
For the rules which types are comparable with which types see areComparable(LogicalType, LogicalType).
-
Constructor Summary
ConstructorsConstructorDescriptionArrayComparableElementArgumentTypeStrategy(StructuredType.StructuredComparison requiredComparison) -
Method Summary
Modifier and TypeMethodDescriptiongetExpectedArgument(FunctionDefinition functionDefinition, int argumentPos) Returns a summary of the function's expected argument atargumentPos.inferArgumentType(CallContext callContext, int argumentPos, boolean throwOnFailure) Main logic for inferring and validating an argument.
-
Constructor Details
-
ArrayComparableElementArgumentTypeStrategy
public ArrayComparableElementArgumentTypeStrategy(StructuredType.StructuredComparison requiredComparison)
-
-
Method Details
-
inferArgumentType
public Optional<DataType> inferArgumentType(CallContext callContext, int argumentPos, boolean throwOnFailure) Description copied from interface:ArgumentTypeStrategyMain logic for inferring and validating an argument. Returns the data type that is valid for the given call. If the returned type differs fromCallContext.getArgumentDataTypes()atargumentPos, a casting operation can be inserted. An empty result means that the given input type could not be inferred.- Specified by:
inferArgumentTypein interfaceArgumentTypeStrategy- Parameters:
callContext- provides details about the function callargumentPos- argument index in theCallContextthrowOnFailure- 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 type as argument", "true, but argument must be casted to returned data type", or "false, no inferred data type could be found"
- See Also:
-
getExpectedArgument
public Signature.Argument getExpectedArgument(FunctionDefinition functionDefinition, int argumentPos) Description copied from interface:ArgumentTypeStrategyReturns a summary of the function's expected argument atargumentPos.- Specified by:
getExpectedArgumentin interfaceArgumentTypeStrategy- Parameters:
functionDefinition- the function definition that defines the function currently being called.argumentPos- the position within the function call for which the signature should be retrieved
-