Skip to content
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

[Question] How to print/explain plans? #417

Open
wangxiaoying opened this issue Mar 18, 2024 · 5 comments
Open

[Question] How to print/explain plans? #417

wangxiaoying opened this issue Mar 18, 2024 · 5 comments

Comments

@wangxiaoying
Copy link

Is there a way to explain (print out) the logical and physical plan for wayang?

@wangxiaoying wangxiaoying changed the title How to print/explain plans? [Question] How to print/explain plans? Mar 18, 2024
@kbeedkar
Copy link
Contributor

A quick and dirty solution as a workaround:

@zkaoudi
Copy link
Contributor

zkaoudi commented Mar 19, 2024

Besides that, @juripetersen is currently implementing an explain() functionality in the plan builder that will print the logical, inflated, and physical plans. It should be ready soon :)

@wangxiaoying
Copy link
Author

Thanks @kbeedkar @zkaoudi for the quick reply : )

Besides that, @juripetersen is currently implementing an explain() functionality in the plan builder that will print the logical, inflated, and physical plans. It should be ready soon :)

Looking forward to this feature! I tried the one using PlanTraversal as suggested above, but it seems like the result is hard to read. For example, the Q1 and Q3 plan it printed from the wayang-benchmark TPCH test is as follows:

Q1:
Map[Calculate result fields]LocalCallbackSink[collect()]Map[Post-process line item aggregates]ReduceBy[Aggregate line items]PostgresTableSource[Load LINEITEM table]Filter[Filter line items]Map[Project line items]

Q3:
Map[Project customer-order join product]Filter[Filter line items]LocalCallbackSink[collect()]PostgresTableSource[Load LINEITEM table]Map[Extract customer ID]PostgresTableSource[Load ORDERS table]Join[Join CO with line items]PostgresTableSource[Load CUSTOMER table]Map[Unpack orders]Map[Project orders]Map[Extract line item data]Map[Project CO-line-item join product]Map[Project customers]Filter[Filter customers]Join[Join customers with orders]Map[Project line items]Filter[Filter orders]ReduceBy[Aggregate revenue]

It is a bit confusing how to interpret these outputs.

@zkaoudi
Copy link
Contributor

zkaoudi commented Mar 24, 2024

Hi @wangxiaoying,

I assume you saw the last merged commit adding the explain functionality. Let us know if you have any further questions. More than happy to help out.

@wangxiaoying
Copy link
Author

Hi @wangxiaoying,

I assume you saw the last merged commit adding the explain functionality. Let us know if you have any further questions. More than happy to help out.

Thank you, I will definitely try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants