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, optimizations = pl\$QueryOptFlags())
Arguments
optimized
|
Optimize the query plan. |
optimizations
|
|
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"]
#> p2[label="AGG [col(\"b\").sum(), col(\"c\").sum()]\nBY\n[col(\"a\")]"]
#> p1[label="SORT BY [col(\"a\")]"]
#> }