Commit 63cb2f8
[SPARK-47241][SQL][FOLLOWUP] Fix issue when laterally referencing a
### What changes were proposed in this pull request?
Fix issue when laterally referencing a `Generator`.
### Why are the changes needed?
Fix the following query pattern:
```
WITH cte AS (SELECT EXPLODE(ARRAY(1, 2, 3)) AS c1, c1) SELECT * FROM cte
```
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Added a test case to `LateralColumnAliasSuite`
### Was this patch authored or co-authored using generative AI tooling?
No
Closes apache#50310 from mihailotim-db/mihailotim-db/generator_lca.
Authored-by: Mihailo Timotic <mihailo.timotic@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 3fb6549)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>Generator
1 parent 4657f42 commit 63cb2f8
3 files changed
Lines changed: 31 additions & 54 deletions
File tree
- sql
- catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis
- core/src/test/scala/org/apache/spark/sql
Lines changed: 7 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2983 | 2983 | | |
2984 | 2984 | | |
2985 | 2985 | | |
2986 | | - | |
2987 | | - | |
2988 | | - | |
2989 | | - | |
2990 | | - | |
2991 | | - | |
2992 | | - | |
2993 | | - | |
2994 | | - | |
2995 | | - | |
2996 | | - | |
2997 | | - | |
2998 | | - | |
2999 | | - | |
3000 | 2986 | | |
3001 | 2987 | | |
3002 | 2988 | | |
| |||
3015 | 3001 | | |
3016 | 3002 | | |
3017 | 3003 | | |
3018 | | - | |
3019 | | - | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
3020 | 3009 | | |
3021 | 3010 | | |
3022 | 3011 | | |
| |||
3061 | 3050 | | |
3062 | 3051 | | |
3063 | 3052 | | |
3064 | | - | |
3065 | | - | |
| 3053 | + | |
| 3054 | + | |
3066 | 3055 | | |
3067 | 3056 | | |
3068 | 3057 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
432 | 439 | | |
433 | 440 | | |
434 | 441 | | |
| |||
Lines changed: 16 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1366 | 1366 | | |
1367 | 1367 | | |
1368 | 1368 | | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
1398 | | - | |
1399 | | - | |
1400 | | - | |
1401 | | - | |
1402 | | - | |
1403 | | - | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
1404 | 1385 | | |
1405 | 1386 | | |
0 commit comments