You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiao Li (JIRA)" <ji...@apache.org> on 2017/02/06 20:30:42 UTC

[jira] [Resolved] (SPARK-19472) [SQL]SQLParser fails to resolve nested CASE WHEN statement with parentheses

     [ https://issues.apache.org/jira/browse/SPARK-19472?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiao Li resolved SPARK-19472.
-----------------------------
       Resolution: Fixed
         Assignee: Herman van Hovell
    Fix Version/s: 2.2.0
                   2.1.1
                   2.0.3

> [SQL]SQLParser fails to resolve nested CASE WHEN statement with parentheses
> ---------------------------------------------------------------------------
>
>                 Key: SPARK-19472
>                 URL: https://issues.apache.org/jira/browse/SPARK-19472
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.1.0
>            Reporter: StanZhai
>            Assignee: Herman van Hovell
>             Fix For: 2.0.3, 2.1.1, 2.2.0
>
>
> SQLParser fails to resolve nested CASE WHEN statement like this:
> select case when
>   (1) +
>   case when 1>0 then 1 else 0 end = 2
> then 1 else 0 end
> from tb
> ==================== Exception ====================
> Exception in thread "main" org.apache.spark.sql.catalyst.parser.ParseException: 
> mismatched input 'then' expecting {'.', '[', 'OR', 'AND', 'IN', NOT, 'BETWEEN', 'LIKE', RLIKE, 'IS', 'WHEN', EQ, '<=>', '<>', '!=', '<', LTE, '>', GTE, '+', '-', '*', '/', '%', 'DIV', '&', '|', '^'}(line 5, pos 0)
> == SQL ==
> select case when
>   (1) +
>   case when 1>0 then 1 else 0 end = 2
> then 1 else 0 end
> ^^^
> from tb
> But,remove parentheses will be fine:
> select case when
>   1 +
>   case when 1>0 then 1 else 0 end = 2
> then 1 else 0 end
> from tb



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org