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

feature request : add an option to display a DAG #154

Open
djouallah opened this issue Aug 25, 2024 · 4 comments
Open

feature request : add an option to display a DAG #154

djouallah opened this issue Aug 25, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@djouallah
Copy link

djouallah commented Aug 25, 2024

it will be nice to have an easy to use option something like to_dag, that automatically show a diagram with all the tables dependencies.

it will something similar to duckdb.sql(" select 42").explain() that automatically generate query plan

image

users seems to like this kind of easy to use functionalities

@eakmanrq
Copy link
Owner

Thanks @djouallah for the request and I agree users would like that. Currently it feels a bit outside of the scope of SQLFrame and I would prefer if I could leverage some other library to generate it. Currently you can generate column-level lineage using the new lineage method but it relies on SQLGlot's implementation which isn't very user friendly. Context: #138

@eakmanrq
Copy link
Owner

One thing to clarify on this request, you want to see a DAG view of a given DataFrame correct? So if the DataFrame joined Table A and Table B then you would want to see a graph of Table A and Table B being joined together? Do you care about column-level lineage in this example?

@djouallah
Copy link
Author

no, I don't care about column lineage

@eakmanrq eakmanrq added the enhancement New feature or request label Nov 19, 2024
@tobymao
Copy link

tobymao commented Dec 7, 2024

you can leverage sqlglot's logical planner

https://github.com/tobymao/sqlglot/blob/main/sqlglot/planner.py

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

No branches or pull requests

3 participants