Jackie-Jiang opened a new pull request, #19302:
URL: https://github.com/apache/pinot/pull/19302

   ## Summary
   
   `DISTINCTCOUNTULL` and `SEGMENTPARTITIONEDDISTINCTCOUNT` read the 
single-value accessors
   (`getIntValuesSV`, `getLongValuesSV`, …) unconditionally, so a multi-value 
column was not something
   they could aggregate at all — unlike the HyperLogLog and bitmap families, 
which have branched on
   `BlockValSet#isSingleValue` for a long time.
   
   Both now do the same. Each of the three entry points dispatches to a 
single-value or a multi-value
   helper, giving these two functions the same nine-method shape 
`DistinctCountHLLAggregationFunction`
   already has:
   
   - `aggregate` → `aggregateSV` / `aggregateMV`
   - `aggregateGroupBySV` → `aggregateSVGroupBySV` / `aggregateMVGroupBySV`
   - `aggregateGroupByMV` → `aggregateSVGroupByMV` / `aggregateMVGroupByMV`
   
   The existing bodies become the single-value helpers unchanged. The new 
multi-value helpers cover the
   dictionary-encoded input (`getDictionaryIdsMV`) and all six stored types.
   
   One detail specific to `SEGMENTPARTITIONEDDISTINCTCOUNT`: its accumulator 
differs by type — `INT`
   goes into a `RoaringBitmap`, every other type into a typed open hash set — 
so the multi-value
   variants preserve that split rather than collapsing to one shape.
   
   ### Behaviour
   
   No existing answer changes. This only makes reachable an input the two 
functions previously could
   not consume. The logical-`BYTES` branch, which carries a serialized sketch 
and is always
   single-value, is untouched.
   
   ### Testing
   
   `SegmentPartitionedDistinctCountAggregationFunctionTest` is new — the 
function had no test at all.
   `DistinctCountULLAggregationFunctionTest` gains the multi-value cases 
alongside its existing
   `canUseStarTree` ones. Both cover `aggregate`, group-by SV and group-by MV 
over a multi-value
   column, plus a check that a single-value column still takes the single-value 
path.
   
   Because `DISTINCTCOUNTULL` is a sketch, its multi-value result is asserted 
to equal the result of
   aggregating the same values flattened into a single-value column, which 
keeps the assertion exact
   instead of resting on an estimate. `SEGMENTPARTITIONEDDISTINCTCOUNT` counts 
exactly, so its answers
   are asserted directly.
   
   `SyntheticBlockValSets` gains a `LongMV` block val set, since it previously 
had no multi-value
   implementation.
   
   ### Incidental
   
   Two copy-paste comments in `DistinctCountULLAggregationFunction` named 
`HyperLogLogPlus` and
   `DISTINCT_COUNT_HLL_PLUS`; both sat inside blocks this change rewrites and 
are corrected. Five
   further occurrences remain in methods this change does not touch, and are 
left alone.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to