Class SsmChunkedPercentileOperator

java.lang.Object
io.deephaven.engine.table.impl.by.ssmpercentile.SsmChunkedPercentileOperator
All Implemented Interfaces:
IterativeChunkedAggregationOperator

public class SsmChunkedPercentileOperator extends Object implements IterativeChunkedAggregationOperator
Percentile operator backed by two SSMs per destination: the low set holds the values at or below the percentile, and the high set holds the rest.

Values are not inserted into or removed from the SSMs as each chunk arrives. Instead, each destination stages the values added to it and the values removed from it (a modification stages its previous value as a removal and its new value as an addition). When the initial state or a cycle's updates are propagated, each touched destination compacts its staged values into sorted, counted runs, nets the removals against the additions so that a value both removed and added touches neither SSM, applies one pivoted removal and one pivoted insertion, and then sets its result. Every destination that receives values reports a modification, whether or not its percentile changes.