grundprinzip opened a new pull request, #38841:
URL: https://github.com/apache/spark/pull/38841
### What changes were proposed in this pull request?
Previously, the `avg` function was missing in the `GroupedData` class. This
patch adds this method and the necessary plan transformation using an
unresolved function. In addition, it identified a small issue where when an
alias is used for a grouping column, the planner would incorrectly try to wrap
the existing alias expression using an unresolved alias which would then fail.
```
df = (
self.connect.range(10)
.groupBy((col("id") % lit(2)).alias("moded"))
.avg("id")
.sort("moded")
)
```
### Why are the changes needed?
Bug / Compatibility
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
UT
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]