nealrichardson commented on a change in pull request #10888:
URL: https://github.com/apache/arrow/pull/10888#discussion_r683681911



##########
File path: r/R/dataset-scan.R
##########
@@ -85,10 +85,22 @@ Scanner$create <- function(dataset,
       # To handle mutate() on Table/RecordBatch, we need to 
collect(as_data_frame=FALSE) now
       dataset <- dplyr::collect(dataset, as_data_frame = FALSE)
     }
+
+    proj<- c(dataset$selected_columns, dataset$temp_columns)
+    if (!is.null(projection)) {
+      # TODO: should we check names and make sure we only project once per?
+      proj <- c(proj, projection)
+    }
+
+    filt <- dataset$filtered_rows
+    if (!isTRUE(filter)) {
+      filt <- build_expr("&", filt, filter)
+    }
+

Review comment:
       Use this helper to handle a few other edge cases (then restore 
`dataset$filtered_rows` in the call to Scanner$create below)
   
   ```suggestion
       if (!isTRUE(filter)) {
         dataset <- set_filter(dataset, filter)
       }
   
   ```




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