apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
5.87k stars 1.11k forks source link

ScalarSubquery to Join failed #6326

Open jackwener opened 1 year ago

jackwener commented 1 year ago

Describe the bug

This feature is not implemented: Physical plan does not support logical expression (<subquery>)

ScalarSubquery to Join failed

explain select c1 from t1 where t1.c2 > (select t2.c2 from t2);
+--------------+---------------------------------------+
| plan_type    | plan                                  |
+--------------+---------------------------------------+
| logical_plan | Projection: t1.c1                     |
|              |   Filter: t1.c2 > (<subquery>)        |
|              |     Subquery:                         |
|              |       Projection: t2.c2               |
|              |         TableScan: t2                 |
|              |     TableScan: t1 projection=[c1, c2] |
+--------------+---------------------------------------+

To Reproduce

CREATE TABLE IF NOT EXISTS t1(c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(12,'DATAFUSION');
CREATE TABLE IF NOT EXISTS t2(c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(12,'DATAFUSION');

select c1 from t1 where t1.c2 > (select t2.c2 from t2);

Expected behavior

No response

Additional context

No response

mingmwang commented 1 year ago

I will work on this.