Skip to content
Snippets Groups Projects
Commit 34ca392d authored by Reynold Xin's avatar Reynold Xin
Browse files

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

parent 58d9b260
No related branches found
No related tags found
No related merge requests found
...@@ -304,7 +304,7 @@ class GroupedData protected[sql]( ...@@ -304,7 +304,7 @@ class GroupedData protected[sql](
// Get the distinct values of the column and sort them so its consistent // Get the distinct values of the column and sort them so its consistent
val values = df.select(pivotColumn) val values = df.select(pivotColumn)
.distinct() .distinct()
.sort(pivotColumn) .sort(pivotColumn) // ensure that the output columns are in a consistent logical order
.map(_.get(0)) .map(_.get(0))
.take(maxValues + 1) .take(maxValues + 1)
.toSeq .toSeq
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment