chenyukang created SPARK-23224:
----------------------------------

             Summary: union all will throw gramma exception
                 Key: SPARK-23224
                 URL: https://issues.apache.org/jira/browse/SPARK-23224
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.2.0
            Reporter: chenyukang


when keyword "limit " in first sub query , this query will fail with gramma 
exception
{code:java}
spark-sql>
         >
         > insert overwrite table tmp_wjmdb.tmp_cyk_test1
         > select * from tmp_wjmdb.abctest limit 10
         > union all
         > select * from tmp_wjmdb.abctest limit 20;
18/01/26 12:18:58 INFO SparkSqlParser: Parsing command: insert overwrite table 
tmp_wjmdb.tmp_cyk_test1
select * from tmp_wjmdb.abctest limit 10
union all
select * from tmp_wjmdb.abctest limit 20
Error in query:
mismatched input 'union' expecting {<EOF>, '.', '[', 'OR', 'AND', 'IN', NOT, 
'BETWEEN', 'LIKE', RLIKE, 'IS', EQ, '<=>', '<>', '!=', '<', LTE, '>', GTE, '+', 
'-', '*', '/', '%', 'DIV', '&', '|', '^'}(line 3, pos 0)

== SQL ==
insert overwrite table tmp_wjmdb.tmp_cyk_test1
select * from tmp_wjmdb.abctest limit 10
union all
^^^
select * from tmp_wjmdb.abctest limit 20
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to