Plot the query plan
Description
This only returns the "dot" output that can be passed to other packages,
such as DiagrammeR::grViz()
.
Usage
<LazyFrame>$to_dot(
...,
optimized = TRUE,
type_coercion = TRUE,
`_type_check` = TRUE,
predicate_pushdown = TRUE,
projection_pushdown = TRUE,
simplify_expression = TRUE,
slice_pushdown = TRUE,
comm_subplan_elim = TRUE,
comm_subexpr_elim = TRUE,
cluster_with_columns = TRUE,
collapse_joins = TRUE,
`_check_order` = TRUE
)
Arguments
…
|
Not used.. |
optimized
|
Optimize the query plan. |
type_coercion
|
A logical, indicates type coercion optimization. |
predicate_pushdown
|
A logical, indicates predicate pushdown optimization. |
projection_pushdown
|
A logical, indicates projection pushdown optimization. |
simplify_expression
|
A logical, indicates simplify expression optimization. |
slice_pushdown
|
A logical, indicates slice pushdown optimization. |
comm_subplan_elim
|
A logical, indicates trying to cache branching subplans that occur on self-joins or unions. |
comm_subexpr_elim
|
A logical, indicates trying to cache common subexpressions. |
cluster_with_columns
|
A logical, indicates to combine sequential independent calls to with_columns. |
collapse_joins
|
Collapse a join and filters into a faster join. |
\_check_order ,
\_type_check
|
For internal use only. |
Value
A character vector
Examples
library("polars")
lf <- pl$LazyFrame(
a = c("a", "b", "a", "b", "b", "c"),
b = 1:6,
c = 6:1
)
query <- lf$group_by("a", .maintain_order = TRUE)$agg(
pl$all()$sum()
)$sort("a")
query$to_dot() |> cat()
#> graph polars_query {
#> p1 -- p2
#> p2 -- p3
#> p3[label="TABLE\nπ 3/3"]
#> p2[label="AGG [col(\"b\").sum(), col(\"c\").sum()]\nBY\n[col(\"a\")]"]
#> p1[label="SORT BY [col(\"a\")]"]
#> }