-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[branch-50] Fix ambiguous column names in substrait conversion #17299 #18077
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
[branch-50] Fix ambiguous column names in substrait conversion #17299 #18077
Conversation
…erals having the same name during conversion. (apache#17299) * Fix ambigious column names in substrate conversion as a result of literals having the same names * move it to the project * do it only for projects * comment * fmt * comments --------- Co-authored-by: Xander Bailey <[email protected]> Co-authored-by: Andrew Lamb <[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.
Looks good to me -- thank you @hareshkh
@alamb - Can you please rerun the CI again? The cargo examples task seems to be stuck in the latest run. |
I did and sadly it seems the tests are still failing: I can try and look at them in the next day or two if no one beats me to it |
@comphead fixed the tests, so merging up to get those fixes |
Thanks again @hareshkh |
…#17299 (apache#18077) ## Which issue does this PR close? - Related to apache#18072 - Related to apache#17294 - Backports apache#17299 to branch-50 ## Rationale for this change Fix ambiguous column names in substrait conversion as a result of literals before and after a join being assigned the same name. More information in the issue, but say you have a NULL literal before a join called "column1" and then you create a new NULL column after the join called column2, you would get an ambiguous column name errors like. ``` Error: SchemaError(AmbiguousReference { field: Column { relation: Some(Bare { table: "left" }), name: "UTF8(NULL)" } }, Some("")) ``` ## What changes are included in this PR? Simply alias all literals as they're converted to have a UUID name. ## Are these changes tested? Yes. Tested by using substrait-java with this query ``` ./isthmus-cli/build/graal/isthmus --create "create table A (a int); create table B (a int, c int); create table C (a int, d int)" "select t.*, C.d, CAST(NULL AS VARCHAR) as e from (select a, CAST(NULL AS VARCHAR) as c from A UNION ALL select a, c from B) t LEFT JOIN C ON t.a = C.a" ``` ## Are there any user-facing changes? Co-authored-by: Xander <[email protected]> Co-authored-by: Xander Bailey <[email protected]> Co-authored-by: Andrew Lamb <[email protected]> (cherry picked from commit e3f8e37)
Which issue does this PR close?
50.3.0
(minor) #18072Rationale for this change
Fix ambiguous column names in substrait conversion as a result of literals before and after a join being assigned the same name.
More information in the issue, but say you have a NULL literal before a join called "column1" and then you create a new NULL column after the join called column2, you would get an ambiguous column name errors like.
What changes are included in this PR?
Simply alias all literals as they're converted to have a UUID name.
Are these changes tested?
Yes.
Tested by using substrait-java with this query
Are there any user-facing changes?