tustvold commented on code in PR #2218:
URL: https://github.com/apache/arrow-datafusion/pull/2218#discussion_r848829549


##########
datafusion/physical-expr/src/physical_expr.rs:
##########
@@ -49,17 +49,15 @@ pub trait PhysicalExpr: Send + Sync + Display + Debug {
         batch: &RecordBatch,
         selection: &BooleanArray,
     ) -> Result<ColumnarValue> {
-        let filter_count = selection
-            .values()
-            .count_set_bits_offset(selection.offset(), selection.len());
-
-        if selection.null_count() == 0 && filter_count == selection.len() {
-            return self.evaluate(batch);
-        }
-
         let tmp_batch = filter_record_batch(batch, &selection)?;
 
         let tmp_result = self.evaluate(&tmp_batch)?;
+        // All values from the `selection` filter are true.
+        if batch.columns().first().map(|x| x.len())

Review Comment:
   `RecordBatch::num_rows()` might be simpler?



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

Reply via email to