tustvold commented on a change in pull request #1248:
URL: https://github.com/apache/arrow-rs/pull/1248#discussion_r800229172
##########
File path: arrow/src/compute/kernels/filter.rs
##########
@@ -185,79 +287,585 @@ pub fn prep_null_mask_filter(filter: &BooleanArray) ->
BooleanArray {
/// # Ok(())
/// # }
/// ```
-pub fn filter(array: &dyn Array, predicate: &BooleanArray) -> Result<ArrayRef>
{
- if predicate.null_count() > 0 {
- // this greatly simplifies subsequent filtering code
- // now we only have a boolean mask to deal with
- let predicate = prep_null_mask_filter(predicate);
- return filter(array, &predicate);
+pub fn filter(values: &dyn Array, predicate: &BooleanArray) ->
Result<ArrayRef> {
Review comment:
Definitely something to measure. I think it would be hard to beat a
strategy that materializes very selective predicates and otherwise just
evaluates predicates against already "eliminated" rows. A masked comparison
kernel, I'd expect to have non-trivial branching overheads, but I honestly
don't know :smile: I guess it also depends on how expensive the predicate is to
evaluate, a complex cast might tip the scales... :thinking:
--
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]