We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Datafusion will try to generate inner join plan for selection, but it does not do ambiguous check. For example:
❯ explain select * from test0, test1 where c0 = c0 + 1; +---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | plan_type | plan | +---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | logical_plan | Projection: test0.c0, test0.c1, test0.c2, test0.c3, test0.c4, test0.c5, test1.c0, test1.c1, test1.c2, test1.c3, test1.c4, test1.c5 | | | CrossJoin: | | | Projection: test0.c0, test0.c1, test0.c2, test0.c3, test0.c4, test0.c5 | | | Filter: CAST(test0.c0 AS Int64)test0.c0 = CAST(test0.c0 AS Int64)test0.c0 + Int64(1) | | | Projection: CAST(test0.c0 AS Int64) AS CAST(test0.c0 AS Int64)test0.c0, test0.c0, test0.c1, test0.c2, test0.c3, test0.c4, test0.c5 | | | TableScan: test0 projection=[c0, c1, c2, c3, c4, c5], partial_filters=[CAST(test0.c0 AS Int64) = CAST(test0.c0 AS Int64) + Int64(1)] | | | TableScan: test1 projection=[c0, c1, c2, c3, c4, c5]
In PostgreSQL, this will throw an error:
PostgreSQL
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 Create two tables -- test0 and test1, which has same schema.
run sql explain select * from test0, test1 where c0 = c0 + 1.
explain select * from test0, test1 where c0 = c0 + 1
Expected behavior
Additional context
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
Datafusion will try to generate inner join plan for selection, but it does not do ambiguous check.
For example:
In
PostgreSQL
, this will throw an error:The semantics of this sql is not clear, we need throw exception like
PostgreSQL
do.To Reproduce
Create two tables -- test0 and test1, which has same schema.
run sql
explain select * from test0, test1 where c0 = c0 + 1
.Expected behavior
Additional context
The text was updated successfully, but these errors were encountered: