nealrichardson commented on a change in pull request #9521: URL: https://github.com/apache/arrow/pull/9521#discussion_r581424395
########## File path: r/R/dplyr.R ########## @@ -309,8 +344,27 @@ collect.arrow_dplyr_query <- function(x, as_data_frame = TRUE, ...) { # See dataset.R for Dataset and Scanner(Builder) classes tab <- Scanner$create(x)$ToTable() } else { - # This is a Table/RecordBatch. See record-batch.R for the [ method - tab <- x$.data[x$filtered_rows, x$selected_columns, keep_na = FALSE] + # This is a Table or RecordBatch + + # Filter and select the data referenced in selected columns + if (isTRUE(x$filtered_rows)) { + filter <- TRUE + } else { + filter <- eval_array_expression(x$filtered_rows, x$.data) + } + # TODO: shortcut if identical(names(x$.data), find_array_refs(x$selected_columns))? + tab <- x$.data[filter, find_array_refs(x$selected_columns), keep_na = FALSE] + # Now evaluate those expressions on the filtered table + cols <- lapply(x$selected_columns, eval_array_expression, data = tab) + if (length(cols) == 0) { + tab <- tab[, integer(0)] Review comment: No, this is in the "else" case, Datasets are handled on L345 ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org