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

[R] show_exec_plan() for an arrow_dplyr_query #30534

Closed
6 tasks done
asfimport opened this issue Dec 7, 2021 · 2 comments
Closed
6 tasks done

[R] show_exec_plan() for an arrow_dplyr_query #30534

asfimport opened this issue Dec 7, 2021 · 2 comments

Comments

@asfimport
Copy link

asfimport commented Dec 7, 2021

{}Proposed approach{}: design doc

Steps

Reporter: Jonathan Keane / @jonkeane
Assignee: Dragoș Moldovan-Grünfeld / @dragosmg

Subtasks:

PRs and other links:

Note: This issue was originally created as ARROW-15016. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Dewey Dunnington / @paleolimbot:
It seems like a route here would be to implement a ToString() and print() as R6 methods here:

print.arrow_dplyr_query <- function(x, ...) {

and here: https://github.com/apache/arrow/blob/master/r/src/compute-exec.cpp#L47

...and add a show_dplyr_query() function here (maybe like this):

library(arrow, warn.conflicts = FALSE)
library(dplyr, warn.conflicts = FALSE)

show_exec_plan <- function(.data) {
  adq <- arrow:::as_adq(.data)
  plan <- arrow:::ExecPlan$create()
  final_node <- plan$Build(.data)
  print(plan$ToString())
  invisible(.data)
}

ggplot2::mpg %>% 
  arrow_table() %>% 
  filter(year > 2007) %>% 
  show_exec_plan()
#> Error in print(plan$ToString()): attempt to apply non-function

Maybe here:

https://github.com/apache/arrow/blob/master/r/R/dplyr.R#L91

@asfimport
Copy link
Author

Dewey Dunnington / @paleolimbot:
Issue resolved by pull request 13541
#13541

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

No branches or pull requests

1 participant