@Internal public final class ComparableTypeStrategy extends Object implements InputTypeStrategy
InputTypeStrategy that checks if all input arguments can be compared with each other
with the minimal provided comparison.
It requires at least one argument. In case of one argument, the argument must be comparable with itself (e.g. for aggregations).
For the rules which types are comparable with which types see areComparable(LogicalType, LogicalType).
| 构造器和说明 |
|---|
ComparableTypeStrategy(ConstantArgumentCount argumentCount,
StructuredType.StructuredComparison requiredComparison) |
| 限定符和类型 | 方法和说明 |
|---|---|
ArgumentCount |
getArgumentCount()
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.
|
public ComparableTypeStrategy(ConstantArgumentCount argumentCount, StructuredType.StructuredComparison requiredComparison)
public ArgumentCount getArgumentCount()
InputTypeStrategygetArgumentCount 在接口中 InputTypeStrategypublic Optional<List<DataType>> inferInputTypes(CallContext callContext, boolean throwOnFailure)
InputTypeStrategyCallContext.getArgumentDataTypes(), a casting operation can be inserted. An empty result
means that the given input is invalid.inferInputTypes 在接口中 InputTypeStrategycallContext - provides details about the function callthrowOnFailure - whether this function is allowed to throw an ValidationException with a meaningful exception in case the inference is not successful
or if this function should simply return an empty result.CallContext.newValidationError(String, Object...)public List<Signature> getExpectedSignatures(FunctionDefinition definition)
InputTypeStrategygetExpectedSignatures 在接口中 InputTypeStrategydefinition - the function definition that defines the function currently being called.Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.