Closed lukas-mi closed 5 years ago
@h4v0kh3l1 One option, arguably less clean but maybe easier, is to over-parse and then complain (in the parent parser) about the forbidden cases.
@h4v0kh3l1 WITH
clause didn't help either. Works just fine on Vertica though.
Query:
CREATE VIEW test_schema.test_table_union AS
(WITH
with_clause AS (
SELECT
a0 AS a,
b0 AS b
FROM test_schema.test_table_0
UNION
SELECT
a1 AS a,
b1 AS b
FROM test_schema.test_table_1)
SELECT * FROM with_clause);
Error:
*** Exception: "-" (line 1, column 7):
unexpected TokWord False "view"
CallStack (from HasCallStack):
error, called at /home/../Parsing.hs:27:17 in main:Parsing
I've been trying out queryparser and stumbled upon an issue - parsing
CREATE VIEW
statements which has any kind ofUNION
clause causes parsing to fail. IfCREATE VIEW
is replaced byCREATE TABLE
, parsing succeeds.Queries:
Code used for parsing:
Produced error: