thisisnic commented on a change in pull request #11175:
URL: https://github.com/apache/arrow/pull/11175#discussion_r712151099
##########
File path: r/R/dplyr-functions.R
##########
@@ -839,22 +839,42 @@ agg_funcs$var <- function(x, na.rm = FALSE, ddof = 1) {
options = list(skip_nulls = na.rm, min_count = 0L, ddof = ddof)
)
}
-
agg_funcs$n_distinct <- function(x, na.rm = FALSE) {
list(
fun = "count_distinct",
data = x,
options = list(na.rm = na.rm)
)
}
-
agg_funcs$n <- function() {
list(
fun = "sum",
data = Expression$scalar(1L),
options = list()
)
}
+agg_funcs$min <- function(..., na.rm = FALSE) {
+ args <- list2(...)
+ if (length(args) > 1) {
+ abort("Multiple arguments to min() not supported in Arrow")
Review comment:
```suggestion
arrow_not_supported("Multiple arguments to min()")
```
##########
File path: r/R/dplyr-functions.R
##########
@@ -839,22 +839,42 @@ agg_funcs$var <- function(x, na.rm = FALSE, ddof = 1) {
options = list(skip_nulls = na.rm, min_count = 0L, ddof = ddof)
)
}
-
agg_funcs$n_distinct <- function(x, na.rm = FALSE) {
list(
fun = "count_distinct",
data = x,
options = list(na.rm = na.rm)
)
}
-
agg_funcs$n <- function() {
list(
fun = "sum",
data = Expression$scalar(1L),
options = list()
)
}
+agg_funcs$min <- function(..., na.rm = FALSE) {
+ args <- list2(...)
+ if (length(args) > 1) {
+ abort("Multiple arguments to min() not supported in Arrow")
+ }
+ list(
+ fun = "min",
+ data = args[[1]],
+ options = list(skip_nulls = na.rm, min_count = 0L)
+ )
+}
+agg_funcs$max <- function(..., na.rm = FALSE) {
+ args <- list2(...)
+ if (length(args) > 1) {
+ abort("Multiple arguments to max() not supported in Arrow")
Review comment:
```suggestion
arrow_not_supported("Multiple arguments to max()")
```
##########
File path: r/tests/testthat/test-dplyr-group-by.R
##########
@@ -62,9 +62,9 @@ test_that("ungroup", {
select(int, chr) %>%
ungroup() %>%
filter(int > 5) %>%
+ collect() %>%
summarize(min_int = min(int)),
Review comment:
```suggestion
# TODO: ARROW-13550 - remove summarize() from here (expect_dplyr_equal
will check attributes)
collect() %>%
summarize(min_int = min(int)),
```
--
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]