Class BuiltInAggregateFunction<T,ACC>

java.lang.Object
org.apache.flink.table.functions.UserDefinedFunction
org.apache.flink.table.functions.ImperativeAggregateFunction<T,ACC>
org.apache.flink.table.functions.AggregateFunction<T,ACC>
org.apache.flink.table.runtime.functions.aggregate.BuiltInAggregateFunction<T,ACC>
All Implemented Interfaces:
Serializable, org.apache.flink.table.functions.FunctionDefinition
Direct Known Subclasses:
ArrayAggFunction, BatchApproxCountDistinctAggFunctions.ApproxCountDistinctAggFunction, CollectAggFunction, FirstValueAggFunction, FirstValueWithRetractAggFunction, JsonArrayAggFunction, JsonObjectAggFunction, LagAggFunction, LastValueAggFunction, LastValueWithRetractAggFunction, ListAggWithRetractAggFunction, ListAggWsWithRetractAggFunction, MaxWithRetractAggFunction, MinWithRetractAggFunction, PercentileAggFunction

@Internal public abstract class BuiltInAggregateFunction<T,ACC> extends org.apache.flink.table.functions.AggregateFunction<T,ACC>
Base class for runtime implementation represented as AggregateFunction that is constructed from BuiltInFunctionDefinition.specialize(SpecializedContext).

Subclasses must offer a constructor that takes SpecializedFunction.SpecializedContext if they are constructed from a BuiltInFunctionDefinition. Otherwise the BuiltInAggregateFunction() constructor might be more appropriate.

By default, all built-in functions work on internal data structures. However, this can be changed by overriding getArgumentDataTypes(), getAccumulatorDataType(), and getOutputDataType(). Or by overriding getTypeInference(DataTypeFactory) directly.

Since the accumulator type is runtime specific, it must be declared explicitly; otherwise it is derived from the output type.

See Also:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    BuiltInAggregateFunction(org.apache.flink.table.functions.BuiltInFunctionDefinition definition, org.apache.flink.table.functions.SpecializedFunction.SpecializedContext context)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.flink.table.types.DataType
     
    List<org.apache.flink.table.types.DataType>
     
    org.apache.flink.table.types.DataType
     
    Set<org.apache.flink.table.functions.FunctionRequirement>
     
    org.apache.flink.table.types.inference.TypeInference
    getTypeInference(org.apache.flink.table.catalog.DataTypeFactory typeFactory)
     
    boolean
     

    Methods inherited from class org.apache.flink.table.functions.AggregateFunction

    getKind, getValue

    Methods inherited from class org.apache.flink.table.functions.ImperativeAggregateFunction

    createAccumulator, getAccumulatorType, getResultType

    Methods inherited from class org.apache.flink.table.functions.UserDefinedFunction

    close, functionIdentifier, open, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.flink.table.functions.FunctionDefinition

    supportsConstantFolding
  • Constructor Details

    • BuiltInAggregateFunction

      protected BuiltInAggregateFunction(org.apache.flink.table.functions.BuiltInFunctionDefinition definition, org.apache.flink.table.functions.SpecializedFunction.SpecializedContext context)
    • BuiltInAggregateFunction

      protected BuiltInAggregateFunction()
  • Method Details

    • getArgumentDataTypes

      public List<org.apache.flink.table.types.DataType> getArgumentDataTypes()
    • getAccumulatorDataType

      public org.apache.flink.table.types.DataType getAccumulatorDataType()
    • getOutputDataType

      public org.apache.flink.table.types.DataType getOutputDataType()
    • getTypeInference

      public org.apache.flink.table.types.inference.TypeInference getTypeInference(org.apache.flink.table.catalog.DataTypeFactory typeFactory)
      Specified by:
      getTypeInference in interface org.apache.flink.table.functions.FunctionDefinition
      Overrides:
      getTypeInference in class org.apache.flink.table.functions.AggregateFunction<T,ACC>
    • getRequirements

      public Set<org.apache.flink.table.functions.FunctionRequirement> getRequirements()
    • isDeterministic

      public boolean isDeterministic()