Commits


Dragoș Moldovan-Grünfeld authored and GitHub committed 9442e1ce8d9
ARROW-15016: [R] `show_exec_plan` for an `arrow_dplyr_query` (#13541) This PR adds `show_exec_plan()` will allow users to inspect the ExecPlan, in a similar way to dplyr's `show_query()`. ```r mtcars %>% arrow_table() %>% filter(mpg > 20) %>% mutate(x = gear/carb) %>% group_by(cyl) %>% show_exec_plan() #> ExecPlan with 3 nodes: #> 2:ProjectNode{projection=[mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb, "x": divide(cast(gear, {to_type=double, allow_int_overflow=false, allow_time_truncate=false, allow_time_overflow=false, allow_decimal_truncate=false, allow_float_truncate=false, allow_invalid_utf8=false}), cast(carb, {to_type=double, allow_int_overflow=false, allow_time_truncate=false, allow_time_overflow=false, allow_decimal_truncate=false, allow_float_truncate=false, allow_invalid_utf8=false}))]} #> 1:FilterNode{filter=(mpg > 20)} #> 0:TableSourceNode{} ``` Some design considerations are discussed in the [design doc](https://docs.google.com/document/d/1Ep8aV4jDsNCCy9uv1bjWY_JF17nzHQogv0EnGJvraQI/edit?usp=sharing). Summary of the approach: * I opted for the `show_exec_plan()` name as I believe it aligns well with the purpose of this PR: to expose the ExecPlan (in its raw state). * We could later extend, beautify the output (e.g. use {cli} and / or `show_query()` / `explain()` methods). Authored-by: Dragoș Moldovan-Grünfeld <dragos.mold@gmail.com> Signed-off-by: Dewey Dunnington <dewey@fishandwhistle.net>