FrankChen021 opened a new issue, #17758:
URL: https://github.com/apache/druid/issues/17758

   for such SQL, 
   ```sql
   select 1;
   ```
   
   The calcite report the following unfriendly error. 
   
   
   ```text
   Suggestion: Remove trailing semicolon (;)
   
   Error: INVALID_INPUT
   
   Received an unexpected token [;] (line [1], column [9]), acceptable options: 
[<EOF>, "ORDER", "LIMIT", "OFFSET", "FETCH", "UNION", "INTERSECT", "EXCEPT", 
"MINUS", ",", "FROM", "AS", <IDENTIFIER>, <HYPHENATED_IDENTIFIER>, 
<QUOTED_IDENTIFIER>, <BACK_QUOTED_IDENTIFIER>, 
<BIG_QUERY_BACK_QUOTED_IDENTIFIER>, <BRACKET_QUOTED_IDENTIFIER>, 
<UNICODE_QUOTED_IDENTIFIER>, <QUOTED_STRING>, ".", "NOT", "IN", "<", "<=", ">", 
">=", "=", "<>", "!=", "BETWEEN", "LIKE", "SIMILAR", "+", "-", "*", "/", "%", 
"||", "AND", "OR", "IS", "MEMBER", "SUBMULTISET", "CONTAINS", "OVERLAPS", 
"EQUALS", "PRECEDES", "SUCCEEDS", "MULTISET", "["]
   ```
   
   It would be more friendly if we remove the semicolon from the SQL 
automatically instead of reporting an error. And because most of databases can 
ignore the semicolon if the input is a single statement, it's reasonable to do 
so.
   
   To remove the trailing semicolon is not the perfect way, because for such 
input:
   
   ```sql
   select 1;
   select 2
   ```
   
   Calcite report the same error too. So maybe we can remove the trailing 
semicolon first, and then catch the parse error, if such exception is raised, 
we should give a clear message saying that multiple statements is not supported.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to