Class OutputArgumentTypeStrategy

java.lang.Object
org.apache.flink.table.types.inference.strategies.OutputArgumentTypeStrategy
All Implemented Interfaces:
ArgumentTypeStrategy

@Internal public final class OutputArgumentTypeStrategy extends Object implements ArgumentTypeStrategy
Strategy for inferring an unknown argument type from the function's output DataType if available.
  • Constructor Details

    • OutputArgumentTypeStrategy

      public OutputArgumentTypeStrategy()
  • Method Details

    • inferArgumentType

      public Optional<DataType> inferArgumentType(CallContext callContext, int argumentPos, boolean throwOnFailure)
      Description copied from interface: ArgumentTypeStrategy
      Main logic for inferring and validating an argument. Returns the data type that is valid for the given call. If the returned type differs from CallContext.getArgumentDataTypes() at argumentPos, a casting operation can be inserted. An empty result means that the given input type could not be inferred.
      Specified by:
      inferArgumentType in interface ArgumentTypeStrategy
      Parameters:
      callContext - provides details about the function call
      argumentPos - argument index in the CallContext
      throwOnFailure - 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.
      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: ArgumentTypeStrategy
      Returns a summary of the function's expected argument at argumentPos.
      Specified by:
      getExpectedArgument in interface ArgumentTypeStrategy
      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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object