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 = deprecated(),
`_check_order` = TRUE
)
Arguments
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()
#> digraph polars_query {
#> rankdir="BT"
#> node [fontname="Monospace", shape="box"]
#> p2 -> p1
#> p3 -> p2
#> 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\")]"]
#> }