dkranchii opened a new pull request, #19685:
URL: https://github.com/apache/pinot/pull/19685

   ## Summary
   
   `CaseTransformFunction` kept each THEN statement's evaluated values in a
   `Map<Integer, ...>` keyed by the statement index, then looked the entry up 
once
   per document. Because the key is an `int`, every document in every value 
block
   paid an `Integer` box plus a hash lookup, purely to index the dense range
   `0..numThenStatements-1`.
   
   This replaces those maps with arrays indexed directly by statement id, across
   all 15 sites: the seven `transformToXValuesSVUsingValue` methods, the seven
   `transformToXValuesSVUsingValueAndNull` methods, and `getNullBitmap`.
   
   The null-handling variants additionally stored a `Pair<X[], RoaringBitmap>` 
per
   statement; those now use two parallel arrays, which also removes an
   `ImmutablePair` allocation per THEN statement per block.
   
   ## Why this is safe
   
   The map keys were always the dense statement index written by
   `getSelectedArray`, and the class already tracks the parallel
   `boolean[] _computeThenStatements` on that same index. A statement that was 
not
   computed yields `null` from the array exactly as it did from the map, so the
   lookup semantics are unchanged.
   
   No public API, wire format, or segment format is touched.
   
   ## Test plan
   
   - [ ] `CaseTransformFunctionTest` passes
   - [ ] `NullHandlingEnabledQueriesTest` passes (covers the 
`...UsingValueAndNull` paths)
   - [ ] `BenchmarkQueriesSSQE` with the `SUM(CASE WHEN ...)` query shows no 
regression


-- 
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