Class ApproxPercentileAccumulator

java.lang.Object
dev.frostlake.functions.aggregate.ApproxPercentileAccumulator
All Implemented Interfaces:
AggregateFunction.Accumulator

public class ApproxPercentileAccumulator extends Object implements AggregateFunction.Accumulator
Accumulator for APPROX_PERCENTILE(expr, percentile). Snowflake computes an approximate percentile from a t-digest sketch; this emulator computes the exact interpolated percentile (identical to PERCENTILE_CONT), which is the best possible approximation and matches Snowflake within its documented error bound for typical data. The percentile (a constant in [0, 1]) is supplied by the executor from the function's second argument via setPercentile(double).