[
https://issues.apache.org/jira/browse/ARROW-15016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17488280#comment-17488280
]
Dewey Dunnington commented on ARROW-15016:
------------------------------------------
It seems like a route here would be to implement a {{ToString()}} and
{{print()}} as R6 methods here:
https://github.com/apache/arrow/blob/bd356295f6beaba744a2c6b498455701f53a64f8/r/R/dplyr.R#L91
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):
{code:R}
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
{code}
Maybe here:
https://github.com/apache/arrow/blob/master/r/R/dplyr.R#L91
> [R] show_query() for an arrow_dplyr_query
> -----------------------------------------
>
> Key: ARROW-15016
> URL: https://issues.apache.org/jira/browse/ARROW-15016
> Project: Apache Arrow
> Issue Type: Improvement
> Components: R
> Reporter: Jonathan Keane
> Priority: Major
> Fix For: 8.0.0
>
>
> Now that we can print a query plan (ARROW-13785) we should wire this up in R
> so we can see what execution plans are being put together for various queries
> (like the TPC-H queries)
--
This message was sent by Atlassian Jira
(v8.20.1#820001)