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
{{ message }}
Repository navigation
unexpected schema field name conflicts in joins #670
Describe the bug
A clear and concise description of what the bug is.
with a join, we'd get false positive schema name collision
To Reproduce
Steps to reproduce the behavior:
this works:
SELECTt1.c9 x
FROM test t1
INNER JOIN test t2
ONt1.c9=t2.c9ORDER BY x;
but this won't:
SELECTt1.c9 x, t1.c1 c1
FROM test t1
INNER JOIN test t2
ONt1.c9=t2.c9ORDER BY x;
Plan("The left schema and the right schema have the following columns with the same name without being on the ON statement: {Column { name: \"c1\", index: 0 }}. Consider aliasing them.")
Expected behavior
A clear and concise description of what you expected to happen.
it shall work as expected (e.g. as in Postgres)
Additional context
Add any other context about the problem here.
I think this might have something to do with our projection push down logic:
> SELECT
t1.c9 x, t1.c1 c1
FROM test t1
INNER JOIN test t2
ON t1.c9 = t2.c9
ORDER BY x;
[datafusion/src/execution/dataframe_impl.rs:148] &plan = Sort: #x ASC NULLS FIRST
Projection: #t1.c9 AS x, #t1.c1 AS c1
Join: #t1.c9 = #t2.c9
TableScan: t1 projection=Some([0, 1])
TableScan: t2 projection=Some([0, 1])
Noticed c1 got pushed down to t2 table scan as well even though it's not being projected. Most likely the projection push down logic is not distinguishing between column names and aliases.
Activity
houqp commentedon Jul 4, 2021
I think this might have something to do with our projection push down logic:
Noticed
c1got pushed down tot2table scan as well even though it's not being projected. Most likely the projection push down logic is not distinguishing between column names and aliases.Jefffrey commentedon Jan 26, 2023
Issue seems resolved now as of latest master:
yukkit commentedon Apr 28, 2023
@alamb resolved, can be closed
alamb commentedon Apr 28, 2023
Thanks @yukkit
fix: Remove castting on decimals with a small precision to decimal256 (…
fix: dictionary decimal vector optimization (apache#705)
fix: Remove castting on decimals with a small precision to decimal256 (…
fix: optimize some bit functions (apache#718)
test: parametrize test_array_functions (apache#678)
Upgrade datafusion 39 (apache#728)