You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/04 14:44:12 UTC
[GitHub] [arrow-datafusion] Jimexist opened a new issue #670: unexpected schema field name conflicts in joins
Jimexist opened a new issue #670:
URL: https://github.com/apache/arrow-datafusion/issues/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:
```sql
SELECT
t1.c9 x
FROM test t1
INNER JOIN test t2
ON t1.c9 = t2.c9
ORDER BY x;
```
but this won't:
```sql
SELECT
t1.c9 x, t1.c1 c1
FROM test t1
INNER JOIN test t2
ON t1.c9 = t2.c9
ORDER 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.
**Additional context**
Add any other context about the problem here.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-datafusion] houqp commented on issue #670: unexpected schema field name conflicts in joins
Posted by GitBox <gi...@apache.org>.
houqp commented on issue #670:
URL: https://github.com/apache/arrow-datafusion/issues/670#issuecomment-873638959
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.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org