Skip to content

Commit

Permalink
Revert "[SPARK-5244] [SQL] add coalesce() in sql parser"
Browse files Browse the repository at this point in the history
This reverts commit 812d367.
  • Loading branch information
JoshRosen authored and bomeng committed Jan 22, 2015
1 parent 5e121f4 commit 10486d4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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, ",")) <~ ")" ^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 10486d4

Please sign in to comment.