Repository: spark
Updated Branches:
  refs/heads/master 58d9b2605 -> 34ca392da


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


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

Branch: refs/heads/master
Commit: 34ca392da7097a1fbe48cd6c3ebff51453ca26ca
Parents: 58d9b26
Author: Reynold Xin <[email protected]>
Authored: Tue Nov 24 14:51:01 2015 -0800
Committer: Reynold Xin <[email protected]>
Committed: Tue Nov 24 14:51:01 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/34ca392d/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