-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add ToString and Print method for JoinRelationSetManager and Fix JoinNode Print #9040
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! This should indeed come in handy when debugging. Just have some notes.
The RelationSetManager keeps track of already created relations. The way these references are stored isn't very intuitive, and muddies the logic as to what the RelationSetManager is actually doing, but it's an efficient implementation if joins have a very large number of relations. Currently it is a type of tree structure where every node has a reference to the relation set.
That being said, can we instead just iterate over all the JoinRelationSets/Values in the tree, add each JoinRelationSet
to a "to_print" variable and print all the join relations created so far? This way we don't have to do this indenting stuff with "child" nodes. Relations technically don't even have children.
For your example, I think a better output would look like this.
RelationSets created:
[0]
[0,1]
[1]
[1,2]
[3]
[2]
[2,3]
859f9a8
to
85f7a16
Compare
77d86a2
to
6da2877
Compare
ac52ef7
to
ad59b1d
Compare
Indeed, I very much agree with your point of view. I have made modifications to the code. |
When we want to debug JoinRelationSetManager., we need to add the ToString and Print method.
f932c44
to
5e4a776
Compare
…rface name to Print().
In addition, I found that PrintJoinNode of JoinNode is not defined. Here I modify it to Print and implement it. |
related issue is #9067 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Pr looks good to me
Thanks |
Merge pull request duckdb/duckdb#9164 from Mause/feature/jdbc-uuid-param Merge pull request duckdb/duckdb#9185 from pdet/adbc_07 Merge pull request duckdb/duckdb#9126 from Maxxen/parquet-kv-metadata Merge pull request duckdb/duckdb#9123 from lnkuiper/parquet_schema Merge pull request duckdb/duckdb#9086 from lnkuiper/json_inconsistent_structure Merge pull request duckdb/duckdb#8977 from Tishj/python_readcsv_multi_v2 Merge pull request duckdb/duckdb#9279 from hawkfish/nsdate-cast Merge pull request duckdb/duckdb#8851 from taniabogatsch/binary_lambdas Merge pull request duckdb/duckdb#8983 from Maxxen/types/fixedsizelist Merge pull request duckdb/duckdb#9318 from Maxxen/fix-unused Merge pull request duckdb/duckdb#9220 from hawkfish/exclude Merge pull request duckdb/duckdb#9230 from Maxxen/json-plan-serialization Merge pull request duckdb/duckdb#9011 from Tmonster/add_create_statement_support_to_fuzzer Merge pull request duckdb/duckdb#9400 from Maxxen/array-fixes Merge pull request duckdb/duckdb#8741 from Tishj/python_import_cache_upgrade Merge fixes Merge pull request duckdb/duckdb#9395 from taniabogatsch/lambda-performance Merge pull request duckdb/duckdb#9427 from Tishj/python_table_support_replacement_scan Merge pull request duckdb/duckdb#9516 from carlopi/fixformat Merge pull request duckdb/duckdb#9485 from Maxxen/fix-parquet-serialization Merge pull request duckdb/duckdb#9388 from chrisiou/issue217 Merge pull request duckdb/duckdb#9565 from Maxxen/fix-array-vector-sizes Merge pull request duckdb/duckdb#9583 from carlopi/feature Merge pull request duckdb/duckdb#8907 from cryoEncryp/new-list-functions Merge pull request duckdb/duckdb#8642 from Virgiel/capi-streaming-arrow Merge pull request duckdb/duckdb#8658 from Tishj/pytype_optional Merge pull request duckdb/duckdb#9040 from Light-City/feature/set_mg
1.When we want to debug JoinRelationSetManager., we need to add the ToString and Print method.
for example: explain SELECT COUNT(*) FROM t1, t2, t3, t4 WHERE t1.c1 = t2.c1 AND t2.c2 = t3.c2 AND t3.c3 = t4.c3 ;
set_manager.Print();
will output:
2.Change PrintJoinNode to Print and implement it.