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](
// 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
......
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