Commit 7515c5c
Revert "[SPARK-47895][SQL] group by alias should be idempotent"
### What changes were proposed in this pull request?
This PR reverts apache#50461 because it introduces a correctness issue by replacing an `Alias` with incorrect literal. A followup will be made with a different way to fix this issue.
### Why are the changes needed?
In the below example, alias `abc` is replaced with `2` resulting in 2 rows instead of correct 3.
Before erronous PR:

After erronous PR:

### Does this PR introduce _any_ user-facing change?
User now sees an error message instead of an incorrect result.
### How was this patch tested?
Added a test case to check for this behavior in the future
### Was this patch authored or co-authored using generative AI tooling?
No
Closes apache#50567 from mihailotim-db/mihailotim-db/revert_group_by.
Authored-by: Mihailo Timotic <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
(cherry picked from commit f970fe2)
Signed-off-by: Wenchen Fan <[email protected]>1 parent 12e10f8 commit 7515c5c
File tree
5 files changed
+21
-31
lines changed- sql
- catalyst/src
- main/scala/org/apache/spark/sql/catalyst/analysis
- test/scala/org/apache/spark/sql/catalyst/analysis
- core/src/test/resources/sql-tests
- analyzer-results
- inputs
- results
5 files changed
+21
-31
lines changedLines changed: 1 addition & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 119 | + | |
132 | 120 | | |
133 | 121 | | |
134 | 122 | | |
| |||
Lines changed: 0 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | 107 | | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
334 | 341 | | |
335 | 342 | | |
336 | 343 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
280 | 290 | | |
281 | 291 | | |
282 | 292 | | |
| |||
0 commit comments