Skip to content
Snippets Groups Projects
Commit 0ec2d2e8 authored by Daoyuan Wang's avatar Daoyuan Wang Committed by Michael Armbrust
Browse files

[SPARK-3531][SQL]select null from table would throw a MatchError

Author: Daoyuan Wang <daoyuan.wang@intel.com>

Closes #2396 from adrian-wang/selectnull and squashes the following commits:

2458229 [Daoyuan Wang] rebase solution
parent 8da10bf1
No related branches found
No related tags found
No related merge requests found
......@@ -244,6 +244,7 @@ object HiveMetastoreTypes extends RegexParsers {
case BooleanType => "boolean"
case DecimalType => "decimal"
case TimestampType => "timestamp"
case NullType => "void"
}
}
......
......@@ -330,6 +330,9 @@ class HiveQuerySuite extends HiveComparisonTest {
createQueryTest("timestamp cast #8",
"SELECT CAST(CAST(-1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1")
createQueryTest("select null from table",
"SELECT null FROM src LIMIT 1")
test("implement identity function using case statement") {
val actual = sql("SELECT (CASE key WHEN key THEN key END) FROM src")
.map { case Row(i: Int) => i }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment