Commits


Dewey Dunnington authored and GitHub committed e6f1f715d7e
ARROW-17361: [R] dplyr::summarize fails with division when divisor is a variable (#14933) Before this PR: ``` r library(dplyr, warn.conflicts = FALSE) library(arrow, warn.conflicts = FALSE) #> Some features are not enabled in this build of Arrow. Run `arrow_info()` for more information. InMemoryDataset$create(data.frame(x = 1:5)) %>% summarize(value = sum(x) / 10) %>% collect() #> # A tibble: 1 × 1 #> value #> <dbl> #> 1 1.5 scale_factor <- 10 InMemoryDataset$create(data.frame(x = 1:5)) %>% summarize(value = sum(x) / scale_factor) %>% collect() #> Error: Error in summarize_eval(names(exprs)[i], exprs[[i]], ctx, length(.data$group_by_vars) > : #> Expression sum(x)/scale_factor is not an aggregate expression or is not supported in Arrow #> Call collect() first to pull data into R. ``` <sup>Created on 2022-12-13 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup> After this PR: ``` r library(dplyr, warn.conflicts = FALSE) library(arrow, warn.conflicts = FALSE) #> Some features are not enabled in this build of Arrow. Run `arrow_info()` for more information. InMemoryDataset$create(data.frame(x = 1:5)) %>% summarize(value = sum(x) / 10) %>% collect() #> # A tibble: 1 × 1 #> value #> <dbl> #> 1 1.5 scale_factor <- 10 InMemoryDataset$create(data.frame(x = 1:5)) %>% summarize(value = sum(x) / scale_factor) %>% collect() #> # A tibble: 1 × 1 #> value #> <dbl> #> 1 1.5 ``` <sup>Created on 2022-12-13 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup> Authored-by: Dewey Dunnington <dewey@voltrondata.com> Signed-off-by: Dewey Dunnington <dewey@voltrondata.com>