Commit 2b3dba1
authored
fix(presto): iterate over copy in eliminate_semi_and_anti_joins (#7455)
When a SELECT has multiple SEMI or ANTI joins,
eliminate_semi_and_anti_joins iterates over the joins list while
calling join.pop(), which mutates the list mid-iteration. This
causes every other SEMI/ANTI join to be skipped, leaving bare
ANTI JOIN / SEMI JOIN syntax in the generated SQL — invalid for
dialects like Presto/Trino that rely on this transform.
Fix: iterate over list(...) so removals don't shift unvisited
elements. Same approach as PR #4364 which fixed the identical
pattern in unnest_to_explode.
Made-with: Cursor1 parent 61bb18c commit 2b3dba1
2 files changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
609 | | - | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
282 | 310 | | |
283 | 311 | | |
284 | 312 | | |
| |||
0 commit comments