Skip to content

Commit

Permalink
Update python dataFrame show test and add empty df unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
云峤 committed May 4, 2015
1 parent 734369c commit a1338f6
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -599,20 +599,22 @@ class DataFrameSuite extends QueryTest {
}

test("SPARK-7319 showString") {
assert(testData.select($"*").showString(1) === """+---+-----+
||key|value|
|+---+-----+
|| 1| 1|
|+---+-----+
|""".stripMargin)
val expectedAnswer = """+---+-----+
||key|value|
|+---+-----+
|| 1| 1|
|+---+-----+
|""".stripMargin
assert(testData.select($"*").showString(1) === expectedAnswer)
}

test("SPARK-7327 show with empty dataFrame") {
assert(testData.select($"*").filter($"key" < 0).showString(1) === """+---+-----+
||key|value|
|+---+-----+
|+---+-----+
|""".stripMargin)
val expectedAnswer = """+---+-----+
||key|value|
|+---+-----+
|+---+-----+
|""".stripMargin
assert(testData.select($"*").filter($"key" < 0).showString(1) === expectedAnswer)
}

test("createDataFrame(RDD[Row], StructType) should convert UDTs (SPARK-6672)") {
Expand Down

0 comments on commit a1338f6

Please sign in to comment.