Class MedianAccumulator

java.lang.Object
dev.frostlake.functions.aggregate.MedianAccumulator
All Implemented Interfaces:
ApproximateAwareAccumulator, CoercedNumericArgumentAccumulator, AggregateFunction.Accumulator

Accumulator for Median, delegating to AggregateNumerics.median(Iterable) so the interpolating percentiles share one typing rule. The values are kept AS THEY ARRIVE rather than as doubles: the median's scale is the input's plus three, and a value collapsed to a double has no scale left to derive it from. A VARCHAR or VARIANT argument is told apart by DECLARATION (CoercedNumericArgumentAccumulator) and takes live's whole-number rule instead.