Commit a76e4fa
Revert [SPARK-54758][SQL] Fix generator resolution order in Project
### What changes were proposed in this pull request?
Reverting my previous PR, because it broke LCA resolution #53527
### Why are the changes needed?
There are 2 problems with LCA:
1. Current implementation breaks a number of queries because it creates a circular dependancy: `Generator` waits for `UnresolvedFunction` and `UnresolvedFunction` waits for generator's LCA which waits `Generator` resolution. I have an idea how to do it properly, but first I want to revert this.
2. A more fundamental problem is that currently generators' LCA could be resolved from right to left, e.g., `SELECT explode(arr) as col, explode(array(array(0), array(1), array(2))) as arr` works. This is quite bizarre, but I will need to break this behavior if I want to enforce left-to-right resolution.
### Does this PR introduce _any_ user-facing change?
'No'
### How was this patch tested?
Add new tests to golden files
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor 2.2.14
Closes #53562 from mikhailnik-db/revert-generator-order-fix.
Authored-by: Mikhail Nikoliukin <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>1 parent 14cc174 commit a76e4fa
File tree
4 files changed
+49
-19
lines changed- sql
- catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis
- core/src/test/resources/sql-tests
- analyzer-results
- inputs
- results
4 files changed
+49
-19
lines changedLines changed: 2 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3065 | 3065 | | |
3066 | 3066 | | |
3067 | 3067 | | |
3068 | | - | |
3069 | | - | |
3070 | | - | |
3071 | | - | |
3072 | | - | |
3073 | | - | |
3074 | | - | |
3075 | 3068 | | |
3076 | 3069 | | |
3077 | 3070 | | |
| |||
3163 | 3156 | | |
3164 | 3157 | | |
3165 | 3158 | | |
3166 | | - | |
3167 | | - | |
3168 | | - | |
3169 | | - | |
3170 | | - | |
3171 | | - | |
| 3159 | + | |
3172 | 3160 | | |
3173 | 3161 | | |
3174 | 3162 | | |
3175 | 3163 | | |
3176 | 3164 | | |
3177 | 3165 | | |
3178 | | - | |
| 3166 | + | |
3179 | 3167 | | |
3180 | | - | |
3181 | 3168 | | |
3182 | 3169 | | |
3183 | 3170 | | |
| |||
3187 | 3174 | | |
3188 | 3175 | | |
3189 | 3176 | | |
3190 | | - | |
3191 | 3177 | | |
3192 | 3178 | | |
3193 | 3179 | | |
| |||
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
0 commit comments