@PublicEvolving
public interface InputTypeStrategy
This interface has three responsibilities during the TypeInference process:
It can help in resolving the type of untyped NULL literals.
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() and Object.equals(Object).
InputTypeStrategies| Modifier and Type | Method and Description |
|---|---|
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.
|
ArgumentCount getArgumentCount()
Optional<List<DataType>> inferInputTypes(CallContext callContext, boolean throwOnFailure)
CallContext.getArgumentDataTypes(),
a casting operation can be inserted. An empty result means that the given input is invalid.callContext - 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...)List<Signature> getExpectedSignatures(FunctionDefinition definition)
definition - the function definition that defines the function currently being called.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.