GitHub user yhuai opened a pull request:

    https://github.com/apache/spark/pull/9828

    [SQL] Restore the 1.5's behavior of planning a single distinct aggregation.

    The impact of this change is for a query that has a single distinct column 
and does not have any grouping expression like
    `SELECT COUNT(DISTINCT a) FROM table`
    The plan will be changed from
    ```
    AGG-2 (count distinct)
      Shuffle to a single reducer
        Partial-AGG-2 (count distinct)
          AGG-1 (grouping on a)
            Shuffle by a
              Partial-AGG-1 (grouping on 1)
    ```
    to the following one (1.5 uses this)
    ```
    AGG-2
      AGG-1 (grouping on a)
        Shuffle to a single reducer
          Partial-AGG-1(grouping on a)
    ```
    The first plan is more robust. However, to better benchmark the impact of 
this change, we should use 1.5's plan and use the conf of 
`spark.sql.specializeSingleDistinctAggPlanning` to control the plan.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/yhuai/spark distinctRewriter

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/9828.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 #9828
    
----
commit 19699f7829323b1e561e1a0ef671c7877128af92
Author: Yin Huai <[email protected]>
Date:   2015-11-19T01:35:11Z

    Restore the 1.5's behavior of planning a single distinct aggregation.

----


---
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]

Reply via email to