You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2017/11/02 13:21:00 UTC

[jira] [Resolved] (SPARK-22408) RelationalGroupedDataset's distinct pivot value calculation launches unnecessary stages

     [ https://issues.apache.org/jira/browse/SPARK-22408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Reynold Xin resolved SPARK-22408.
---------------------------------
       Resolution: Fixed
         Assignee: Patrick Woody
    Fix Version/s: 2.3.0

> RelationalGroupedDataset's distinct pivot value calculation launches unnecessary stages
> ---------------------------------------------------------------------------------------
>
>                 Key: SPARK-22408
>                 URL: https://issues.apache.org/jira/browse/SPARK-22408
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.2.0
>            Reporter: Patrick Woody
>            Assignee: Patrick Woody
>             Fix For: 2.3.0
>
>
> When calculating the distinct values for a pivot in RelationalGroupedDataset (https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/RelationalGroupedDataset.scala#L322), we sort before doing a take(maxValues + 1).
> We should be able to improve this by adding a global limit before the sort, which should reduce the work of the sort, and by simply doing a collect to avoid multiple launching multiple stages as a part of the take. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org