jonkeane commented on a change in pull request #10888:
URL: https://github.com/apache/arrow/pull/10888#discussion_r698754176
##########
File path: r/R/dataset-scan.R
##########
@@ -85,9 +86,30 @@ 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)) {
+ if (is.character(projection)) {
+ proj <- proj[projection]
+ } else if (is_list_of(projection, "Expression")) {
+ # TODO: need to check and see if there are any Expressions that are
simply
+ # field refs in projections, but are richer expressions in proj?
+ proj <- projection
Review comment:
If I'm reading[ DuckDB's
source](https://github.com/duckdb/duckdb/blob/979a798219262349e8c2c3d52ef203a04d6ee728/tools/rpkg/src/register.cpp#L86)
correctly they are only using strings for projection. I'll pull out the expr +
make the appropriate todos/jiras. This might get simpler with the exec node
stuff you're working on too / we might be able to push this complexity down to
that at some point in the future.
After I pull it out, I'll run some test data through duckdb to ensure that
we aren't hitting anything funny there either.
--
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]