spark git commit: [SPARK-10591][SQL][TEST] Add a testcase to ensure if `checkAnswer` handles map correctly

2016-06-27 Thread lian
Repository: spark
Updated Branches:
  refs/heads/branch-2.0 ea8d419c1 -> 664426e00


[SPARK-10591][SQL][TEST] Add a testcase to ensure if `checkAnswer` handles map 
correctly

## What changes were proposed in this pull request?

This PR adds a testcase to ensure if `checkAnswer` handles Map type correctly.

## How was this patch tested?

Pass the jenkins tests.

Author: Dongjoon Hyun 

Closes #13913 from dongjoon-hyun/SPARK-10591.

(cherry picked from commit 11f420b4bbcd607346204fb6fd7db7efe948cdac)
Signed-off-by: Cheng Lian 


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/664426e0
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/664426e0
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/664426e0

Branch: refs/heads/branch-2.0
Commit: 664426e003bb83e020800798013cf5d8a68051f2
Parents: ea8d419
Author: Dongjoon Hyun 
Authored: Mon Jun 27 19:04:50 2016 +0800
Committer: Cheng Lian 
Committed: Mon Jun 27 19:05:18 2016 +0800

--
 .../src/test/scala/org/apache/spark/sql/DatasetSuite.scala| 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/664426e0/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
--
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala 
b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
index bd8479b..43cbc03 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
@@ -34,6 +34,13 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
 
   private implicit val ordering = Ordering.by((c: ClassData) => c.a -> c.b)
 
+  test("checkAnswer should compare map correctly") {
+val data = Seq((1, "2", Map(1 -> 2, 2 -> 1)))
+checkAnswer(
+  data.toDF(),
+  Seq(Row(1, "2", Map(2 -> 1, 1 -> 2
+  }
+
   test("toDS") {
 val data = Seq(("a", 1), ("b", 2), ("c", 3))
 checkDataset(


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org



spark git commit: [SPARK-10591][SQL][TEST] Add a testcase to ensure if `checkAnswer` handles map correctly

2016-06-27 Thread lian
Repository: spark
Updated Branches:
  refs/heads/master 52d4fe057 -> 11f420b4b


[SPARK-10591][SQL][TEST] Add a testcase to ensure if `checkAnswer` handles map 
correctly

## What changes were proposed in this pull request?

This PR adds a testcase to ensure if `checkAnswer` handles Map type correctly.

## How was this patch tested?

Pass the jenkins tests.

Author: Dongjoon Hyun 

Closes #13913 from dongjoon-hyun/SPARK-10591.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/11f420b4
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/11f420b4
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/11f420b4

Branch: refs/heads/master
Commit: 11f420b4bbcd607346204fb6fd7db7efe948cdac
Parents: 52d4fe0
Author: Dongjoon Hyun 
Authored: Mon Jun 27 19:04:50 2016 +0800
Committer: Cheng Lian 
Committed: Mon Jun 27 19:04:50 2016 +0800

--
 .../src/test/scala/org/apache/spark/sql/DatasetSuite.scala| 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/spark/blob/11f420b4/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
--
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala 
b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
index bd8479b..43cbc03 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala
@@ -34,6 +34,13 @@ class DatasetSuite extends QueryTest with SharedSQLContext {
 
   private implicit val ordering = Ordering.by((c: ClassData) => c.a -> c.b)
 
+  test("checkAnswer should compare map correctly") {
+val data = Seq((1, "2", Map(1 -> 2, 2 -> 1)))
+checkAnswer(
+  data.toDF(),
+  Seq(Row(1, "2", Map(2 -> 1, 1 -> 2
+  }
+
   test("toDS") {
 val data = Seq(("a", 1), ("b", 2), ("c", 3))
 checkDataset(


-
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org