You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Datafusion failed to execute select * from (t1 cross join t2) as t cross join t3 with error message
Error during planning: Projections require unique expression names but the expression "t.a" at position 0 and "t.a" at position 2 have the same name. Consider aliasing ("AS") one of them.
I tested on sqlite3 and it return expected result.
latest commit: 840499f
To Reproduce
create table t1 (a int, b int);
create table t2 (a int, b int);
create table t3 (a int, b int);
insert into t1 values (1, 2);
insert into t2 values (3, 4);
insert into t3 values (5, 6);
select * from (t1 cross join t2) as t cross join t3;
I tested the sqllite3 and it does not support ambiguous expressions on the tmp table. But when I create a table, it could work, and the table schema turns out to add another :1 to the columns, I guess we could do what they do.
The rule is here, basically, we need to implement two things
I. first one, in select * from (t1 cross join t2) as t cross join t3. if t is a tmp table and there are no other actions on that tmp table. we just ignore the 'as t' since this works
II. the rest following the design of sqlite3, when create a real table, change its schema and add a ':num' to the name of the column inorder to make this works
Activity
Jefffrey commentedon Feb 5, 2024
Related: #6543
Lordworms commentedon Feb 5, 2024
I want to try this one
Lordworms commentedon Feb 7, 2024
I tested the sqllite3 and it does not support ambiguous expressions on the tmp table. But when I create a table, it could work, and the table schema turns out to add another :1 to the columns, I guess we could do what they do.

Lordworms commentedon Feb 7, 2024
The rule is here, basically, we need to implement two things


I. first one, in select * from (t1 cross join t2) as t cross join t3. if t is a tmp table and there are no other actions on that tmp table. we just ignore the 'as t' since this works
II. the rest following the design of sqlite3, when create a real table, change its schema and add a ':num' to the name of the column inorder to make this works
fix: issue apache#9130 substitute redundant columns when doing cross …
fix: issue apache#9130 substitute redundant columns when doing cross …
fix: issue #9130 substitute redundant columns when doing cross join (#…