GitHub user gatorsmile opened a pull request:
https://github.com/apache/spark/pull/11208
[SPARK-13320] [SQL] Star Expansion for Dataframe/Dataset Functions
This PR resolves two issues:
First, expanding * inside aggregate functions of structs when using
Dataframe/Dataset APIs. For example,
```scala
structDf.groupBy($"a").agg(min(struct($"record.*")))
```
Second, it improves the error messages when invalid star usage.
```scala
pagecounts4PartitionsDS
.map(line => (line._1, line._3))
.toDF()
.groupBy($"_1")
.agg(sum("*") as "sumOccurances")
```
Before the fix, the invalid usage will issue confusing the error message:
```
org.apache.spark.sql.AnalysisException: cannot resolve '_1' given input
columns _1, _2;
```
cc: @rxin @nongli @cloud-fan
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gatorsmile/spark sumDataSetResolution
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/11208.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #11208
----
----
---
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]