neilconway opened a new pull request, #25723:
URL: https://github.com/apache/datafusion/pull/25723

   ## Which issue does this PR close?
   
   - N/A
   
   ## Rationale for this change
   
   When `IGNORE NULLS` is specified, `array_agg` discards NULLs from its input 
by passing a "keep" bitmap to the `filter` kernel. The distinct and ordered 
`array_agg` accumulators built this keep bitmap bit-by-bit, by iterating over 
the input's logical null buffer. That is inefficient: we can just use the null 
buffer as-is. The plain `array_agg` accumulator already did just that.
   
   Benchmarks: `distinct_array_agg` benchmark, M4 Max, 8192 rows
   
       - low cardinality: unchanged
       - high cardinality: unchanged
       - low cardinality, 10% nulls, ignore nulls: 109.5 us -> 102.2 us (6.7% 
faster)
       - high cardinality, 10% nulls, ignore nulls: 244.0 us -> 236.0 us (3.3% 
faster)
   
   ## What changes are included in this PR?
   
   * Introduce a shared helper, `non_null_mask`, to return the keep mask
   * Use the new helper in the distinct and ordered `array_agg` accumulators
   * Extend benchmark to cover `IGNORE NULLS`
   
   ## What is the testing strategy for this PR?
   
   Covered by existing tests.
   
   ## Are there any user-facing changes?
   
   No.
   


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