Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
marmbrus committed Nov 14, 2014
1 parent afd7562 commit b98799d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll {
Seq(Seq("1")))
}

test("sorting") {
def sortTest() = {
checkAnswer(
sql("SELECT * FROM testData2 ORDER BY a ASC, b ASC"),
Seq((1,1), (1,2), (2,1), (2,2), (3,1), (3,2)))
Expand Down Expand Up @@ -238,6 +238,20 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll {
mapData.collect().sortBy(_.data(1)).reverse.toSeq)
}

test("sorting") {
val before = externalSortEnabled
setConf(SQLConf.EXTERNAL_SORT, "false")
sortTest()
setConf(SQLConf.EXTERNAL_SORT, before.toString)
}

test("external sorting") {
val before = externalSortEnabled
setConf(SQLConf.EXTERNAL_SORT, "true")
sortTest()
setConf(SQLConf.EXTERNAL_SORT, before.toString)
}

test("limit") {
checkAnswer(
sql("SELECT * FROM testData LIMIT 10"),
Expand Down

0 comments on commit b98799d

Please sign in to comment.