-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EPIC] Complete SQL EXPLAIN
Tree Rendering
#14914
Comments
SQL EXPLAIN
Tree Rendering
I made a first PR to show how to add tree explain Once we get that one in I plan to file a bunch of other tickets for the remaining |
This looks great! Would it be possible to extend this with svg output? It would be great for ballista ui |
There is already a graphviz version (that kind of looks crappy). Since the output is text, perhaps there is some way to render text as a svg 🤔 |
For the setting side, how about using the existing datafusion/datafusion/sql/src/statement.rs Lines 213 to 222 in ed517ef
We can also try to support GRAPHVIZ format in this way, it should be easier to be rendered to svg. |
This is a great idea @waynexia It seems like AnalyzeFormat currently only supports Text, JSON, and GRAPHVIZ 🤔 https://docs.rs/sqlparser/latest/sqlparser/ast/enum.AnalyzeFormat.html It would be a good way to show graphviz plans |
I filed the following ticket for this I also filed a ticket to avoid printing logical plans when in tree mode |
Here is another PR to improve DataSource: |
ballista uses graphviz-rust which generates those sub-optimal images (and needs local graph viz installation). spark uses a javascript framework which works much better for them. Maybe we should keep |
I think that if we just made it easier to use the existing formats, that would be a big win. |
Is your feature request related to a problem or challenge?
#14677 introduces basic tree rendering for SQL EXPLAIN output but requires follow-up work to improve completeness, test coverage, and code quality. Below are the key tasks and enhancements needed:
Here is an example of running the new explains:
The output looks like
Items to complete
Information Completion for all
ExecutionPlans
The current implementation lacks detailed information for many physical plans.
Add rendering logic for missing operators (In every physical plan's
fmt_as
function).tree
explain forFilterExec
#15000DataSourceExec
#15029tree
explain forProjectionExec
#15023tree
explain forAggregateExec
#15024tree
explain forLocalLimitExec
#15025tree
explain forGlobalLimitExec
#15026tree
explain forPartialSortExec
tree
explain forSortExec
tree
explain forRepartitionExec
tree
explain forBoundedWindowAggExec
tree
explain forWindowAggExec
tree
explain forSortPreservingMergeExec
tree
explain forHashJoinExec
tree
explain forSymmetricHashJoinExec
tree
explain forCrossJoinExec
tree
explain forNestedLoopJoinExec
tree
explain forSortMergeJoinExec
tree
explain forStreamingTableExec
tree
explain forValuesExec
tree
explain forWorkTableExec
tree
explain forInterleaveExec
tree
explain forLazyMemoryExec
tree
explain forForeignExecutionPlan
tree
explain forJsonSink
tree
explain forCsvSink
tree
explain forArrowFileSink
New Features:
EXPLAIN
formats via SQL #15021tree
explain format #15020Process / Documentation
tree
explain in the user documentationTreeRender
in DisplayFormatType`tree
explain by defaultTest Coverage Expansion
Code Cleanup & Improvements
TODOs
explain tree
formatting for longer lines / word wrap #15019Make variables (e.g., indentation size, truncation thresholds) configurable:
Dead Code Removal
Remove or utilize the unused Coordinate struct:
The text was updated successfully, but these errors were encountered: