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 2022/11/14 02:50:34 UTC

[GitHub] [arrow-datafusion] ygf11 opened a new issue, #4197: Add ambiguous check when generate join plan

ygf11 opened a new issue, #4197:
URL: https://github.com/apache/arrow-datafusion/issues/4197

   **Describe the bug**
   For some join sql whose meaning is not clear, datafusion will not throw error.
   For example, `test0` and `test1` both has `c0` column.
   ```sql
   ❯ explain select * from test0 as t0 inner join test0 as t1 on c0 = c0;
   +---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                                                                                                                                    |
   +---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: t0.c0, t0.c1, t0.c2, t0.c3, t0.c4, t0.c5, t1.c0, t1.c1, t1.c2, t1.c3, t1.c4, t1.c5                                                                          |
   |               |   Inner Join: t0.c0 = t1.c0                                                                                                                                             |
   |               |     SubqueryAlias: t0                                                                                                                                                   |
   |               |       TableScan: test0 projection=[c0, c1, c2, c3, c4, c5]                                                                                                              |
   |               |     SubqueryAlias: t1                                                                                                                                                   |
   |               |       TableScan: test0 projection=[c0, c1, c2, c3, c4, c5]                                                                                                              |
   ```
   In PostgreSQL, this will throw an error:
   ```sql
   psql -d "$POSTGRES_DB" -h "$POSTGRES_HOST" -p "$POSTGRES_PORT" -U "$POSTGRES_USER" -c "explain select * from test0 as t0 inner join test0 as t1 on c0 = c0;"
   ERROR:  column reference "c0" is ambiguous
   LINE 1: ...select * from test0 as t0 inner join test0 as t1 on c0 = c0;
                                                                  ^
   ```
   
   The semantics of this sql is not clear, we need throw exception like PostgreSQL do.
   
   
   **To Reproduce**
   `test0` and `test1` both has `c0` column.
   
   Then run `explain select * from test0 as t0 inner join test0 as t1 on c0 = c0;`.
   
   **Expected behavior**
   
   **Additional context**
   


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb closed issue #4197: Add ambiguous check when generate join plan

Posted by GitBox <gi...@apache.org>.
alamb closed issue #4197: Add ambiguous check when generate join plan
URL: https://github.com/apache/arrow-datafusion/issues/4197


-- 
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] mingmwang commented on issue #4197: Add ambiguous check when generate join plan

Posted by GitBox <gi...@apache.org>.
mingmwang commented on issue #4197:
URL: https://github.com/apache/arrow-datafusion/issues/4197#issuecomment-1315517111

   It is a bug, we should fix it.


-- 
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