Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-17361: [R] dplyr::summarize fails with division when divisor is a variable #14933

Merged
merged 2 commits into from Dec 14, 2022

Conversation

paleolimbot
Copy link
Member

Before this PR:

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.

Created on 2022-12-13 with reprex v2.0.2

After this PR:

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

Created on 2022-12-13 with reprex v2.0.2

@github-actions
Copy link

@github-actions
Copy link

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

Copy link
Member

@thisisnic thisisnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@paleolimbot paleolimbot merged commit e6f1f71 into apache:master Dec 14, 2022
@paleolimbot paleolimbot deleted the r-summarise-eval-names branch December 14, 2022 15:53
@ursabot
Copy link

ursabot commented Dec 15, 2022

Benchmark runs are scheduled for baseline = ea34cfc and contender = e6f1f71. e6f1f71 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️0.13% ⬆️0.03%] test-mac-arm
[Finished ⬇️0.54% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.52% ⬆️0.03%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] e6f1f715 ec2-t3-xlarge-us-east-2
[Failed] e6f1f715 test-mac-arm
[Finished] e6f1f715 ursa-i9-9960x
[Finished] e6f1f715 ursa-thinkcentre-m75q
[Finished] ea34cfce ec2-t3-xlarge-us-east-2
[Finished] ea34cfce test-mac-arm
[Finished] ea34cfce ursa-i9-9960x
[Finished] ea34cfce ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants