Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[SPARK-12298][SQL] Fix infinite loop in DataFrame.sortWithinPartitions
Modifies the String overload to call the Column overload and ensures
this is called in a test.
  • Loading branch information
ankurdave committed Dec 12, 2015
commit d9f8c258803aba0e676b798ce5085b52d69f70f7
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ class DataFrame private[sql](
*/
@scala.annotation.varargs
def sortWithinPartitions(sortCol: String, sortCols: String*): DataFrame = {
sortWithinPartitions(sortCol, sortCols : _*)
sortWithinPartitions((sortCol +: sortCols).map(Column(_)) : _*)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1090,8 +1090,8 @@ class DataFrameSuite extends QueryTest with SharedSQLContext {
}

// Distribute into one partition and order by. This partition should contain all the values.
val df6 = data.repartition(1, $"a").sortWithinPartitions($"b".asc)
// Walk each partition and verify that it is sorted descending and not globally sorted.
val df6 = data.repartition(1, $"a").sortWithinPartitions("b")
// Walk each partition and verify that it is sorted ascending and not globally sorted.
df6.rdd.foreachPartition { p =>
var previousValue: Int = -1
var allSequential: Boolean = true
Expand Down