cboumalh opened a new pull request, #53548:
URL: https://github.com/apache/spark/pull/53548

   ### What changes were proposed in this pull request?
   
   This PR adds SQL aggregate functions with their tests for the KLL merge 
aggregate functions:
   - `kll_merge_agg_bigint` 
   - `kll_merge_agg_float`
   - `kll_merge_agg_double`
   
   These aggregate functions merge multiple binary KLL sketch representations.
   
   ### Why are the changes needed?
   
   The existing scalar `kll_sketch_merge_*` functions can only merge two 
sketches at a time. In distributed computing scenarios where sketches are 
pre-computed across multiple partitions, time windows, or datasets, users need 
to merge many sketches together.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, this PR adds 3 new aggregate functions.
   
   ### How was this patch tested?
   
   New SQL tests were added to 
`sql/core/src/test/resources/sql-tests/inputs/kllquantiles.sql`:
   
   **Positive tests:**
   - Merging bigint/float/double sketches from multiple rows
   - Merging with custom k parameters (400, 300, 500)  
   - NULL value handling
   
   **Negative tests:**
   - Type mismatches (passing non-binary types)
   - Invalid binary data
   - k parameter validation (too small, too large, NULL, non-constant)
   
   ### Was this patch authored or co-authored using generative AI tooling?
   claude-4.5-sonnet and manual changes.
   


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