Skip to content

Commit

Permalink
define show_arrow_query() and add it to print.arrow_dplyr_query()
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosmg committed Jul 7, 2022
1 parent be94c0e commit faeea48
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions r/R/dplyr.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ print.arrow_dplyr_query <- function(x, ...) {
sep = ""
)
}

show_arrow_query(x)

cat("See $.data for the source Arrow object\n")
invisible(x)
}
Expand Down Expand Up @@ -219,6 +222,15 @@ tail.arrow_dplyr_query <- function(x, n = 6L, ...) {
x
}

show_arrow_query <- function(.data) {
adq <- arrow:::as_adq(.data)
plan <- arrow:::ExecPlan$create()
final_node <- plan$Build(.data)
cat("* ExecPlan\n")
cat(plan$ToString())
invisible(.data)
}

ensure_group_vars <- function(x) {
if (inherits(x, "arrow_dplyr_query")) {
# Before pulling data from Arrow, make sure all group vars are in the projection
Expand Down

0 comments on commit faeea48

Please sign in to comment.