GitHub user hvanhovell opened a pull request:
https://github.com/apache/spark/pull/15101
[SPARK-17114][SQL] Fix aggregates grouped by literals with empty input
## What changes were proposed in this pull request?
This PR fixes an issue with aggregates that have an empty input, and use a
literals as their grouping keys. These aggregates are currently interpreted as
aggregates **without** grouping keys, this triggers the ungrouped code path
(which aways returns a single row).
This PR fixes the `RemoveLiteralFromGroupExpressions` optimizer rule, which
changes the semantics of the Aggregate by eliminating all literal grouping keys.
## How was this patch tested?
Added tests to `SQLQueryTestSuite`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hvanhovell/spark SPARK-17114-3
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15101.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 #15101
----
commit 25eee308137c9ec034f8326e23de46958e7a8b20
Author: Herman van Hovell <[email protected]>
Date: 2016-09-14T20:52:34Z
attempt 3
----
---
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]