-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
When a LEFT JOIN ON clause contains a constant false conjunct (e.g., ON a = x AND 1 > 2), the optimizer currently keeps it as a filter: false on the JoinEdge.
This means the join executes but never matches any rows.
The optimal plan would eliminate the join entirely and produce left rows with NULL right columns, since a false filter guarantees no right row can ever match.
Current behavior
SELECT * FROM t LEFT JOIN u ON a = x AND 1 > 2Plan:
HashJoin[LEFT a=x, filter: false]
TableScan[t]
TableScan[u]
Expected behavior
The join should be eliminated. The plan should scan only t and project NULLs for the right-side columns:
Project[a, b, c, null AS x, null AS y]
TableScan[t]
Test coverage
A test case exists in JoinTest.leftJoinOnClausePushdown that documents the current behavior and references this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers