-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
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
Physical planner does not support subquery expression #791
Comments
It looks like you have duplicated brackets around subqueries. It should be I can get results with the following queries after removing a pair of brackets for each: SELECT * FROM integers WHERE column1 IN (SELECT column1 FROM integers);
SELECT * FROM integers WHERE column1 NOT IN (SELECT column1 FROM integers WHERE column1=1);
SELECT * FROM integers WHERE column1 IN (SELECT column1 FROM integers) AND column1<3 ;
SELECT i1.column1,i2.column1 FROM integers i1, integers i2 WHERE column1 IN (SELECT column1 FROM integers) AND i1.column1=i2.column1 ; |
wait for apache/datafusion#5529 |
Does PostgreSQL support this? |
When I tried this, postgres errors: postgres=# CREATE TABLE integers(i INTEGER, j BIGINT);
CREATE TABLE
postgres=# INSERT INTO integers VALUES (1, 1), (2, 2), (3, 3), (NULL, 4);
INSERT 0 4
postgres=# SELECT i1.i,i2.i FROM integers i1, integers i2 WHERE i IN ((SELECT i FROM integers)) AND i1.i=i2.i ORDER BY 1;
ERROR: column reference "i" is ambiguous
LINE 1: ...ECT i1.i,i2.i FROM integers i1, integers i2 WHERE i IN ((SEL... |
I've tested all 4 sqls in mysql, pg and duckdb. The last sql all failed with some error like "...ambiguous column i...". However, the other 3 are good. |
What type of bug is this?
Unexpected error
What subsystems are affected?
Datanode
What happened?
Looks like a datafusion feature missing: https://github.com/apache/arrow-datafusion/blob/master/datafusion/physical-expr/src/planner.rs#L446
Create a table and insert some data:
Run queries:
All these queries fail with the error:
What operating system did you use?
Mac Osx
Relevant log output and stack trace
No response
How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: