ianmcook commented on a change in pull request #10780:
URL: https://github.com/apache/arrow/pull/10780#discussion_r676617698
##########
File path: r/R/dplyr-summarize.R
##########
@@ -18,19 +18,24 @@
# The following S3 methods are registered on load if dplyr is present
-summarise.arrow_dplyr_query <- function(.data, ...) {
- call <- match.call()
- .data <- arrow_dplyr_query(.data)
- if (query_on_dataset(.data)) {
- not_implemented_for_dataset("summarize()")
+summarise.arrow_dplyr_query <- function(.data, ..., .engine = c("arrow",
"duckdb")) {
+ if (match.arg(.engine) == "duckdb") {
+ tbl <- to_duckdb(.data)
+ dplyr::summarise(tbl, ...)
+ } else {
+ call <- match.call()
+ .data <- arrow_dplyr_query(.data)
+ if (query_on_dataset(.data)) {
+ not_implemented_for_dataset("summarize()")
+ }
+ exprs <- quos(...)
+ # Only retain the columns we need to do our aggregations
Review comment:
Why not also retain only the columns we need to do aggregations when
`.engine == "duckdb"`?
--
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]