-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of joins with filter containing correlated joins
In a query like: SELECT n.nspname AS schema, t.typname AS typename, t.oid::int4 AS typeid FROM pg_type t LEFT JOIN pg_catalog.pg_namespace n ON n.oid = t.typnamespace WHERE EXISTS (SELECT 1 FROM pg_catalog.pg_type el WHERE el.oid = t.typelem); The filter `EXISTS (SELECT 1 FROM pg_catalog.pg_type el WHERE el.oid = t.typelem)` was placed in-between correlated-join and join: └ CorrelatedJoin[typname, oid, typnamespace, typelem, nspname, oid, (SELECT 1 FROM (el))] (rows=0) └ Filter[EXISTS (SELECT 1 FROM (el))] (rows=0) └ NestedLoopJoin[LEFT | (oid = typnamespace)] (rows=unknown) Given that the filter uses the output of the `CorrelatedJoin`, that led to an error: Couldn't create execution plan from logical plan because of: Couldn't find (SELECT 1 FROM (el)) in SourceSymbols The filter must be placed above the correlated join, not below. Fixes #14671
- Loading branch information
1 parent
58c216b
commit fec2966
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters