tustvold commented on code in PR #2218:
URL: https://github.com/apache/arrow-datafusion/pull/2218#discussion_r848814692
##########
datafusion/physical-expr/src/physical_expr.rs:
##########
@@ -51,23 +49,21 @@ pub trait PhysicalExpr: Send + Sync + Display + Debug {
batch: &RecordBatch,
selection: &BooleanArray,
) -> Result<ColumnarValue> {
- if selection.iter().all(|b| b == Some(true)) {
+ let filter = match selection.null_count() {
+ 0 => BooleanArray::from(selection.data().clone()),
+ _ => prep_null_mask_filter(selection),
+ };
+
+ let filter_count = filter
+ .values()
+ .count_set_bits_offset(selection.offset(), selection.len());
+
+ if filter_count == selection.len() {
return self.evaluate(batch);
Review Comment:
This logic is already handled upstream, I don't see a reason to duplicate it
here?
See
https://github.com/apache/arrow-rs/blob/master/arrow/src/compute/kernels/filter.rs#L331
--
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]