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

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   - Partially addresses #18181.
   
   ## Rationale for this change
   
   Previous observations in #18181 suggested that `array_has` is relatively 
slow.
   
   `compare_with_eq()` checks for matching array elements in the entire buffer 
in a single pass, which is fast. We then need to use the results of that pass 
to determine a result for each row of the input. The previous implementation 
did this by creating a BooleanArray slice for every row and checking if any of 
the bits in that slice were set.
   
   It is faster to instead iterate over the set bits in the equality array in a 
single pass. For each row, we can use its offsets to determine if there is a 
set bit for the row in the equality array.
   
   ## What changes are included in this PR?
   
   In addition to the optimization, this commit adjusts the `array_has` 
benchmark code to actually benchmark `array_has` evaluation (!). The previous 
benchmark just constructed an `Expr`.
   
   ## Are these changes tested?
   
   Yes, will post benchmarks shortly.
   
   ## 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