Github user clockfly commented on the issue:
https://github.com/apache/spark/pull/14546
Similar case happens to order by. We don't need "order by ordinal" to
reproduce the Analysis error.
```
'Sort ('a)
+- Aggregate [2], [count(1) AS count(1)#83L, a#81]
+- SubqueryAlias tmp
+- Project [1 AS a#81]
+- OneRowRelation$
```
Aggregate is treated as resolved even if it has a group by ordinal "2".
Then, it tries to resolve the Sort by putting the `SortOrder` expression of
Sort as a aggregation expression:
```
!'Aggregate [2], ['a]
+- SubqueryAlias tmp
+- Project [1 AS a#81]
+- OneRowRelation$
```
This plan is wrong because we are asking for ordinal "2", but actually
there is only one
aggregation expression ['a]
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]