-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Query Planner] Add physical plan visualization option to `df.explain…
…()`; implement `TreeVisitor` for `LogicalPlan` and `PhysicalPlan`. (#1836) This PR adds a physical plan visualization option to `df.explain()` (currently opt-in, off by default). In service of this, this PR also implements `TreeVisitor` for `PhysicalPlan` and, as a drive-by, for `LogicalPlan`. This should make expressing plan traversals much easier in the future. ## Physical Plan Visualization Example ```python In [1]: import daft In [2]: df = daft.from_pydict({"a": [1, 2, 3], "b": ["a", "b", "c"], "c": [True, False, True]}) In [3]: df = df.select("a", "b") In [4]: df = df.with_column("d", df["a"] + 1) In [5]: df = df.where(df["d"] < 4) In [6]: df.explain(include_physical=True) Logical plan: * Filter: col(d) < lit(4) | * Project: col(a), col(b), col(a) + lit(1) AS d | * Project: col(a), col(b) | * Source: | Number of partitions = 1 | Output schema = a (Int64), b (Utf8), c (Boolean) Physical plan: * Filter: col(d) < lit(4) | * Project: col(a), col(b), col(a) + lit(1) AS d | Partition spec = { Scheme = Unknown, Num partitions = 1 } | * Project: col(a), col(b) | Partition spec = { Scheme = Unknown, Num partitions = 1 } | * InMemoryScan: | Schema = a (Int64), b (Utf8), c (Boolean) | Size bytes = 60 | Partition spec = { Scheme = Unknown, Num partitions = 1 } ```
- Loading branch information
1 parent
db7cfd1
commit f471738
Showing
69 changed files
with
1,375 additions
and
292 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.