GitHub user hvanhovell opened a pull request:
[SPARK-17616][SQL] Support a single distinct aggregate combined with a
## What changes were proposed in this pull request?
We currently cannot execute an aggregate that contains a single distinct
aggregate function and an one or more non-partially plannable aggregate
functions, for example:
group by 1
This is a regression from Spark 1.6. This is caused by the fact that the
single distinct aggregation code path assumes that all aggregates can be
planned in two phases (is partially aggregatable). This PR works around this
issue by triggering the `RewriteDistinctAggregates` in such cases (this is
similar to the approach taken in 1.6).
## How was this patch tested?
Created `RewriteDistinctAggregatesSuite` which checks if the aggregates
with distinct aggregate functions get rewritten into two `Aggregates` and an
`Expand`. Added a regression test to `DataFrameAggregateSuite`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/hvanhovell/spark SPARK-17616
Alternatively you can review and apply these changes as the patch at:
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #15187
Author: Herman van Hovell <hvanhov...@databricks.com>
Add case to RewriteDistinctAggregates to rewrite a single distinct
aggregate combined with a non-partial aggregate.
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 infrastruct...@apache.org or file a JIRA ticket
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org