You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/04/12 19:54:15 UTC

[GitHub] [arrow-datafusion] Dandandan commented on a diff in pull request #2218: Use `filter` (filter_record_batch) instead of `take` to avoid using indices

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


##########
datafusion/physical-expr/src/physical_expr.rs:
##########
@@ -51,23 +47,15 @@ pub trait PhysicalExpr: Send + Sync + Display + Debug {
         batch: &RecordBatch,
         selection: &BooleanArray,
     ) -> Result<ColumnarValue> {
-        if selection.iter().all(|b| b == Some(true)) {
+        let filter_count = selection

Review Comment:
   I thought this as well, but the earlier fast path also avoided the `scatter` path in case of all values being true.
   The filter count can not easily be reused between this code and the `filter` kernel.
   
   I am also OK with removing this path, for making the code a bit 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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org