Repository: spark
Updated Branches:
  refs/heads/branch-1.6 6d8c4c644 -> 36a99f93f


Added a line of comment to explain why the extra sort exists in pivot.

(cherry picked from commit 34ca392da7097a1fbe48cd6c3ebff51453ca26ca)
Signed-off-by: Reynold Xin <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/36a99f93
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/36a99f93
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/36a99f93

Branch: refs/heads/branch-1.6
Commit: 36a99f93f7d77dac1159e5703d931d24cb24b154
Parents: 6d8c4c6
Author: Reynold Xin <[email protected]>
Authored: Tue Nov 24 14:51:01 2015 -0800
Committer: Reynold Xin <[email protected]>
Committed: Tue Nov 24 16:23:40 2015 -0800

----------------------------------------------------------------------
 sql/core/src/main/scala/org/apache/spark/sql/GroupedData.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/36a99f93/sql/core/src/main/scala/org/apache/spark/sql/GroupedData.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/GroupedData.scala 
b/sql/core/src/main/scala/org/apache/spark/sql/GroupedData.scala
index ee7150c..abd531c 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/GroupedData.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/GroupedData.scala
@@ -304,7 +304,7 @@ class GroupedData protected[sql](
     // Get the distinct values of the column and sort them so its consistent
     val values = df.select(pivotColumn)
       .distinct()
-      .sort(pivotColumn)
+      .sort(pivotColumn)  // ensure that the output columns are in a 
consistent logical order
       .map(_.get(0))
       .take(maxValues + 1)
       .toSeq


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to