Package dev.frostlake.functions
Class AggregateFunction
java.lang.Object
dev.frostlake.functions.BuiltInFunction
dev.frostlake.functions.AggregateFunction
- Direct Known Subclasses:
AnyValue,ApproxCountDistinct,ApproxPercentile,ApproxPercentileAccumulate,ApproxPercentileCombine,ApproxTopK,ApproxTopKAccumulate,ApproxTopKCombine,ArrayAgg,ArrayUnionAgg,ArrayUniqueAgg,Avg,BitAndAgg,BitOrAgg,BitXorAgg,BooleanAggregate,Corr,Count,CountIf,CovarPop,CovarSamp,HashAgg,Kurtosis,ListAgg,Max,MaxBy,Median,Min,MinBy,Mode,ObjectAgg,PercentileCont,PercentileDisc,RegrAvgx,RegrAvgy,RegrCount,RegrIntercept,RegrR2,RegrSlope,RegrSxx,RegrSxy,RegrSyy,Skew,StdDev,StdDevPop,StdDevSamp,Sum,Variance,VarPop,VarSamp,VectorAvg,VectorMax,VectorMin,VectorSum
Base class for aggregate functions (SUM, COUNT, LISTAGG, …). An aggregate is a
BuiltInFunction whose per-group state lives in an AggregateFunction.Accumulator: the executor creates
one accumulator per group, folds every input value into it, and reads the group's result from it at
the end. BuiltInFunction.evaluate(java.util.List<java.lang.Object>) is therefore not the aggregation path, and implementations typically
return null from it.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe running state of one aggregate over one group: values are folded in one row at a time and the group's result is read out at the end. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAggregateFunction(String name, DataType returnType) Names the aggregate and fixes its declared result type. -
Method Summary
Modifier and TypeMethodDescriptionabstract AggregateFunction.AccumulatorCreates the fresh, empty per-group state for one evaluation of this aggregate; the executor makes one per group (or per window partition) and never shares them.Methods inherited from class dev.frostlake.functions.BuiltInFunction
approximateRejection, binaryRejection, booleanRejection, evaluate, evaluate, fileRejection, geoRejection, getMaxArgCount, getMinArgCount, getName, getReturnType, isVariadic, refusesMissingArgumentsByType, semiStructuredRejection, structuredRejection, temporalRejection, temporalRejection, temporalRejection, textRejection, uuidRejection, vectorRejection
-
Constructor Details
-
AggregateFunction
Names the aggregate and fixes its declared result type.- Parameters:
name- the SQL name the aggregate is registered underreturnType- the declared type of the aggregate's result
-
-
Method Details
-
createAccumulator
Creates the fresh, empty per-group state for one evaluation of this aggregate; the executor makes one per group (or per window partition) and never shares them.- Returns:
- a new accumulator starting from this aggregate's empty-group state
-