diff options
author | Daoyuan Wang <daoyuan.wang@intel.com> | 2015-02-01 18:51:38 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2015-02-01 18:51:38 -0800 |
commit | 8cf4a1f02e40f37f940f6a347c078f5879585bf4 (patch) | |
tree | 430ebc09a5753a8cb1738ce289be6057b1dbd0c2 /sql/core | |
parent | 1b56f1d6bb079a669ae83e70ee515373ade2a469 (diff) | |
download | spark-8cf4a1f02e40f37f940f6a347c078f5879585bf4.tar.gz spark-8cf4a1f02e40f37f940f6a347c078f5879585bf4.tar.bz2 spark-8cf4a1f02e40f37f940f6a347c078f5879585bf4.zip |
[SPARK-5262] [SPARK-5244] [SQL] add coalesce in SQLParser and widen types for parameters of coalesce
I'll add test case in #4040
Author: Daoyuan Wang <daoyuan.wang@intel.com>
Closes #4057 from adrian-wang/coal and squashes the following commits:
4d0111a [Daoyuan Wang] address Yin's comments
c393e18 [Daoyuan Wang] fix rebase conflicts
e47c03a [Daoyuan Wang] add coalesce in parser
c74828d [Daoyuan Wang] cast types for coalesce
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala index d684278f11..d82c34316c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala @@ -88,6 +88,18 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll { setConf(SQLConf.CODEGEN_ENABLED, originalValue.toString) } + test("Add Parser of SQL COALESCE()") { + checkAnswer( + sql("""SELECT COALESCE(1, 2)"""), + Row(1)) + checkAnswer( + sql("SELECT COALESCE(null, 1, 1.5)"), + Row(1.toDouble)) + checkAnswer( + sql("SELECT COALESCE(null, null, null)"), + Row(null)) + } + test("SPARK-3176 Added Parser of SQL LAST()") { checkAnswer( sql("SELECT LAST(n) FROM lowerCaseData"), |