hareshkh opened a new pull request, #18077:
URL: https://github.com/apache/datafusion/pull/18077
## Which issue does this PR close?
Related to #18072
Related to #17294
## 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?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]