GitHub user aray opened a pull request:
https://github.com/apache/spark/pull/9815
[SPARK-11275] [SQL] Incorrect results when using rollup/cube
Fixes bug with grouping sets (including cube/rollup) where aggregates that
included grouping expressions would return the wrong (null) result.
Also simplifies the analyzer rule a bit and leaves column pruning to the
optimizer.
Added multiple unit tests to DataFrameAggregateSuite and verified it passes
hive compatibility suite:
```
build/sbt -Phive -Dspark.hive.whitelist='groupby.*_grouping.*' 'test-only
org.apache.spark.sql.hive.execution.HiveCompatibilitySuite'
```
This is an alternative to pr https://github.com/apache/spark/pull/9419 but
I think its better as it simplifies the analyzer rule instead of adding another
special case to it.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aray/spark groupingset-agg-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/9815.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 #9815
----
commit 12914fa00cbe195e8985a4881a40229efdd1c84f
Author: Andrew Ray <[email protected]>
Date: 2015-11-18T19:10:22Z
Fixes bug with grouping sets (including cube/rollup) where aggregates that
included grouping expressions would return the wrong (null) result.
Also simplifies the analyzer rule a bit and leaves column pruning to the
optimizer.
----
---
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]