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

   ## Which issue does this PR close?
   
   - Closes #25426.
   
   ## Rationale for this change
   
   When one argument of `array_has_any` is a scalar and the element type is not 
a string, the fast path `array_has_any_with_scalar_general` row-converts the 
list column's full child array, which does a lot of unnecessary work for sliced 
lists. 
   
   Benchmarks:
   
   - array_has_any_scalar/i64_no_match_sliced/1: 4.14 ms -> 167.4 µs, −96.0%
   - array_has_any_scalar/i64_no_match_sliced/10: 4.11 ms -> 125.9 µs, −96.9%
   - array_has_any_scalar/i64_no_match_sliced/100: 4.25 ms -> 257.8 µs, −93.9%
   - array_has_any_scalar/i64_no_match_sliced/1000: 4.12 ms -> 141.1 µs, −96.6%
   
   Results on unsliced inputs were unchanged, within run-to-run noise.
   
   ## What changes are included in this PR?
   
   * Improve `array_has_any_with_scalar_general` to only touch the visible 
portion of the input list
   * Add a benchmark
   * Add unit tests for correct behavior on sliced lists
   
   ## What is the testing strategy for this PR?
   
   Existing tests pass, new tests added. Benchmark confirms that the 
inefficiency has been addressed.
   
   ## 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