-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 catalog as part of the table path in plan_to_sql #10612
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.
Thanks @y-f-u!
Co-authored-by: Phillip LeBlanc <[email protected]>
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 @y-f-u
And thank you for the review @phillipleblanc
It is somewhat hard to find the exsting tests for sql_to_plan. That might be nice to improve sometime
Field::new("id", DataType::Utf8, false), | ||
Field::new("value", DataType::Utf8, false), | ||
]); | ||
let plan = table_scan(Some(table_name), &schema, None) |
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.
Since this is testing plan_to_sql
it might make more sense to put it with the rest of the tests for plan_to_sql: https://github.com/apache/datafusion/blob/main/datafusion/sql/tests/sql_integration.rs#L4669
However, the fact that those tests don't have "plan_to_sql" in their name is confusing too.
Maybe we could consolidate the tests into something like datafusion/sql/tests/sql_integration/plan_to_sql.rs
🤔 (as a follow on PR)
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.
Filed #10635 to track
Thanks again @y-f-u and @phillipleblanc |
* add catalog as part of the table path in plan_to_sql * Update datafusion/sql/src/unparser/plan.rs Co-authored-by: Phillip LeBlanc <[email protected]> --------- Co-authored-by: Phillip LeBlanc <[email protected]>
Which issue does this PR close?
TableReference has the catalog information but it's not used in
plan_to_sql
Part of #9494
Rationale for this change
It's common for DBMS to have pattern of
[catalog.][schema.]table_name
in SQL statement. E.g. snowflake.What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?
No