Description
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
(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