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

   ## Summary
   
   Serialized multi-stage GROUP BY merging allocates a separate composite-key 
array for every input row, allocates intermediate arrays that are immediately 
replaced, and creates temporary numeric objects during dictionary insertion and 
result conversion. These allocations grow with partial-row and group counts.
   
   Extract key columns using the existing extraction helper and reuse one 
composite-key scratch array, allocate only the outer intermediate-result array, 
use primitive `putIfAbsent` in numeric ID maps, and reuse numeric wrappers when 
their type already matches. Composite-key generators retain dictionary IDs 
rather than the scratch array. Null handling, numeric conversions, 
floating-point key behavior and group limits remain unchanged.
   
   ## Validation
   
   - 41 focused/existing cases pass: `NumericToIdMapTest`, `TypeUtilsTest`, 
`MultistageGroupByExecutorTest`, and `AggregateOperatorTest`.
   - Affected-module Spotless, license and Checkstyle checks pass; no compiler 
warnings on added lines.
   - A local real-executor probe with 1,463,737 serialized partial rows and 
914,051 INT/DOUBLE groups measured **382.29 → 287.18 MB allocated per 
merge/result operation (24.9% less)**. Across two JVM forks with 16 measured 
runs per arm, median thread CPU was 370.69 → 359.52 ms and median wall time was 
427.52 → 384.33 ms. Inputs and output validation are outside the measured 
region; every output key, weight and count is verified. This is local operator 
evidence, not an end-to-end latency or retained-heap claim.
   
   No public API, wire format, configuration default or permanent benchmark is 
added.
   


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