nealrichardson commented on code in PR #13541:
URL: https://github.com/apache/arrow/pull/13541#discussion_r920006145


##########
r/R/dplyr.R:
##########
@@ -219,6 +219,31 @@ tail.arrow_dplyr_query <- function(x, n = 6L, ...) {
   x
 }
 
+#' Show the details of an Arrow Execution Plan
+#'
+#' This is a function which gives more details about the Execution Plan 
(`ExecPlan`)
+#' of an `arrow_dplyr_query` object. It is similar to `dplyr::explain()`.
+#'
+#' @param x an `arrow_dplyr_query` to print the `ExecPlan` for.
+#'
+#' @return The argument, invisibly.
+#' @export
+#'
+#' @examplesIf arrow_with_dataset() & requireNamespace("dplyr", quietly = TRUE)
+#' library(dplyr)
+#' mtcars %>%
+#'   arrow_table() %>%
+#'   filter(mpg > 20) %>%
+#'   mutate(x = gear/carb) %>%
+#'   show_exec_plan()
+show_exec_plan <- function(x) {

Review Comment:
   Okay, I see your case for why not `explain()`, you want to make something 
more R-user friendly. So then this seems like `show_query()`. The only reason I 
see in your doc for not using show_query is "`show_query()` states that one of 
its aims is to provide a more human readable output that `str()`". That's a 
really low bar here, given what str() does with R6 classes. 
   
   My recommendation, for what it's worth: in this PR, make this function be 
both `show_query` and `explain`, and in a followup, add more human 
embellishment to `explain()`. (`dbplyr:::explain.tbl_sql`, for example, calls 
show_query() and then prints more details after it.)



-- 
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]

Reply via email to