Skip to content
Snippets Groups Projects
Commit b328ac6c authored by Josh Rosen's avatar Josh Rosen
Browse files

Revert "[SPARK-5244] [SQL] add coalesce() in sql parser"

This reverts commit 812d3679.
parent 8361078e
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,6 @@ class SqlParser extends AbstractSparkSQLParser {
protected val CACHE = Keyword("CACHE")
protected val CASE = Keyword("CASE")
protected val CAST = Keyword("CAST")
protected val COALESCE = Keyword("COALESCE")
protected val COUNT = Keyword("COUNT")
protected val DECIMAL = Keyword("DECIMAL")
protected val DESC = Keyword("DESC")
......@@ -296,7 +295,6 @@ class SqlParser extends AbstractSparkSQLParser {
{ case s ~ p => Substring(s, p, Literal(Integer.MAX_VALUE)) }
| (SUBSTR | SUBSTRING) ~ "(" ~> expression ~ ("," ~> expression) ~ ("," ~> expression) <~ ")" ^^
{ case s ~ p ~ l => Substring(s, p, l) }
| COALESCE ~ "(" ~> repsep(expression, ",") <~ ")" ^^ { case exprs => Coalesce(exprs) }
| SQRT ~ "(" ~> expression <~ ")" ^^ { case exp => Sqrt(exp) }
| ABS ~ "(" ~> expression <~ ")" ^^ { case exp => Abs(exp) }
| ident ~ ("(" ~> repsep(expression, ",")) <~ ")" ^^
......
......@@ -86,15 +86,6 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll {
setConf(SQLConf.CODEGEN_ENABLED, originalValue.toString)
}
test("Add Parser of SQL COALESCE()") {
checkAnswer(
sql("""SELECT COALESCE(1, 2)"""),
1)
checkAnswer(
sql("SELECT COALESCE(null, null, null)"),
null)
}
test("SPARK-3176 Added Parser of SQL LAST()") {
checkAnswer(
sql("SELECT LAST(n) FROM lowerCaseData"),
......
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