datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

the select clause after union all has many same name columns needn't use different aliases

Open l1t1 opened this issue 1 year ago • 0 comments

Is your feature request related to a problem or challenge?

now it reports an error

> select 1 a,2 b union all select null,null;
Error during planning: Projections require unique expression names but the expression "NULL" at position 0 and "NULL" at position 1 have the same name. Consider aliasing ("AS") one of them.
> select 1 a,2 b union all select 2,2;
Error during planning: Projections require unique expression names but the expression "Int64(2)" at position 0 and "Int64(2)" at position 1 have the same name. Consider aliasing ("AS") one of them.

Describe the solution you'd like

It runs as normal the result of above query equals to select 1 a,2 b union all select null,null c and select 1 a,2 b union all select 2,2 c

Describe alternatives you've considered

No response

Additional context

No response

l1t1 avatar Apr 26 '24 05:04 l1t1