Commit dc1db95
committed
[SPARK-36867][SQL] Fix error message with GROUP BY alias
### What changes were proposed in this pull request?
When checking unresolved attributes, we should check `Aggregate.aggregateExpressions` before `Aggregate.groupingExpressions`, because the latter may rely on the former, due to the GROUP BY alias feature.
### Why are the changes needed?
improve error message
### Does this PR introduce _any_ user-facing change?
no
### How was this patch tested?
new test
Closes #34244 from cloud-fan/bug.
Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>1 parent a453fd5 commit dc1db95
File tree
3 files changed
+30
-12
lines changed- sql
- catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis
- core/src/test/resources/sql-tests
- inputs
- results
3 files changed
+30
-12
lines changedLines changed: 17 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
169 | 176 | | |
170 | 177 | | |
171 | 178 | | |
| |||
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
212 | | - | |
| 219 | + | |
213 | 220 | | |
214 | 221 | | |
215 | | - | |
| 222 | + | |
216 | 223 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
227 | | - | |
228 | 232 | | |
229 | 233 | | |
230 | 234 | | |
231 | 235 | | |
232 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
233 | 239 | | |
234 | 240 | | |
235 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
164 | 173 | | |
165 | 174 | | |
166 | 175 | | |
| |||
0 commit comments