-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
For certain queries with subqueries, DataFusion optimizes them as a LEFT join without condition (ScalarSubqueryToJoin
).
A recent addition to require conditions for joins (#15334) has added the validation that causes problems in this type of query now:
---- cases::roundtrip_logical_plan::scalar_subquery_in_select stdout ----
Error: Plan("join condition should not be empty")
To Reproduce
SELECT a, (SELECT MAX(b) FROM data2) as max_b FROM data
Returns error:
Error: Plan("join condition should not be empty")
Expected behavior
Boolean(true)
in the filter:
Projection: data.a, max(data2.b) AS max_b
Left Join:
TableScan: data projection=[a]
Aggregate: groupBy=[[]], aggr=[[max(data2.b)]]
TableScan: data2 projection=[b], partial_filters=[Boolean(true)]
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working