Class FloatRollupUniqueOperator

java.lang.Object
io.deephaven.engine.table.impl.by.ssmcountdistinct.unique.FloatRollupUniqueOperator
All Implemented Interfaces:
IterativeChunkedAggregationOperator

public class FloatRollupUniqueOperator extends Object implements IterativeChunkedAggregationOperator
This operator computes the single unique value of a particular aggregated state at the second and higher levels of a rollup. Each constituent state below reports, via its value column and its singletonCount column, whether it is empty (0/NULL_LONG), uniquely a single value (> 0), or non-unique (< 0).

This operator ignores the values of non-unique constituents, tracking only how many constituents are non-unique (nonUniqueCount); a single such constituent forces this state's result to the non-unique sentinel. The values of the unique constituents are gathered into a multiset: a single distinct value lives in singletonValue with its count in singletonCount, and two or more distinct values are held in an SSM in ssms.

singletonCount is also the column a grandparent reads, so it encodes both the result and the multiset's count: 0/NULL_LONG empty, > 0 the unique count, and < 0 non-unique. When a non-unique constituent forces a non-unique result while the multiset still holds a single value, that value's count C is preserved as -1 - C (using the otherwise-unused [NULL_LONG, -2] range) so it survives until the non-unique constituents are gone; an ssms entry, when present, means two or more distinct values.