You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing a query, if it has more than one statement, the statement of index 1+ has to start with a correct keyword to be correctly identified as an statement and therefore parsed.
For these examples the ExceptionError listener is turned off.
Note in the last example how it needs a correct first keyword to keep parsing statements, even if the third 'statement' is correct, this only seems to apply from the first statement onward.
surister
changed the title
Second statement will not be parsed if first keyword is not correct
Second+ statement will not be parsed if first keyword is not correct
Jun 3, 2024
surister
changed the title
Second+ statement will not be parsed if first keyword is not correct
Second+ statement will not be parsed (as DefaultContext) if first keyword is not correct
Jun 7, 2024
This only seems to happen when second+ statement is wrong.
For:
-- This is a commentSELECT A, B, C, D FROM tbl1;
-- This is a 2nd commentSELECT1; -- This is a 3rd commentSELECT D, A FROM tbl1 WHERE;
tree.children is [[244], ;, [246], ;, [246], ;, <EOF>] where they are DefaultContext
For:
-- This is a commentSELECT A, B, C, D FROM tbl1;
-- This is a 2nd comment
SELEC 1; -- This is a 3rd commentSELECT D, A FROM tbl1 WHERE;
tree.children is [[244], ;, SELEC, 1, ;, SELECT, D, ,, A, FROM, tbl1, WHERE, ;] where only the first one is DefaultContext and the rest are ErrorNodeImpl
surister
changed the title
Second+ statement will not be parsed (as DefaultContext) if first keyword is not correct
Second+ statement will not be parsed (as DefaultContext) if first statement is not correct
Oct 28, 2024
When parsing a query, if it has more than one statement, the statement of index 1+ has to start with a correct keyword to be correctly identified as an statement and therefore parsed.
For these examples the
ExceptionError
listener is turned off.Ex:
Note in the last example how it needs a correct first keyword to keep parsing statements, even if the third 'statement' is correct, this only seems to apply from the first statement onward.
Definition of statements: https://github.com/crate/crate/blob/302c91871ca5c6b34dac07c01ef03f6f2e0017ee/libs/sql-parser/src/main/antlr/io/crate/sql/parser/antlr/SqlBaseParser.g4#L26
The text was updated successfully, but these errors were encountered: