diff options
author | Michael Armbrust <michael@databricks.com> | 2014-08-05 11:17:50 -0700 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2014-08-05 11:18:00 -0700 |
commit | 388ab534b318e6736484a2fab6f88390abbf8c55 (patch) | |
tree | 2a79ff8740ae921c76272b6043bbe80afd3a866c /sql/hive/src | |
parent | e3fe6571decfdc406ec6d505fd92f9f2b85a618c (diff) | |
download | spark-388ab534b318e6736484a2fab6f88390abbf8c55.tar.gz spark-388ab534b318e6736484a2fab6f88390abbf8c55.tar.bz2 spark-388ab534b318e6736484a2fab6f88390abbf8c55.zip |
[SPARK-2860][SQL] Fix coercion of CASE WHEN.
Author: Michael Armbrust <michael@databricks.com>
Closes #1785 from marmbrus/caseNull and squashes the following commits:
126006d [Michael Armbrust] better error message
2fe357f [Michael Armbrust] Fix coercion of CASE WHEN.
(cherry picked from commit 6e821e3d1ae1ed23459bc7f1098510b968130152)
Signed-off-by: Michael Armbrust <michael@databricks.com>
Diffstat (limited to 'sql/hive/src')
-rw-r--r-- | sql/hive/src/test/resources/golden/null case-0-581cdfe70091e546414b202da2cebdcb | 1 | ||||
-rw-r--r-- | sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sql/hive/src/test/resources/golden/null case-0-581cdfe70091e546414b202da2cebdcb b/sql/hive/src/test/resources/golden/null case-0-581cdfe70091e546414b202da2cebdcb new file mode 100644 index 0000000000..d00491fd7e --- /dev/null +++ b/sql/hive/src/test/resources/golden/null case-0-581cdfe70091e546414b202da2cebdcb @@ -0,0 +1 @@ +1 diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala index aa810a2912..2f0be49b6a 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala @@ -32,6 +32,9 @@ case class TestData(a: Int, b: String) */ class HiveQuerySuite extends HiveComparisonTest { + createQueryTest("null case", + "SELECT case when(true) then 1 else null end FROM src LIMIT 1") + createQueryTest("single case", """SELECT case when true then 1 else 2 end FROM src LIMIT 1""") |