Xinyi Yu created SPARK-38456:
--------------------------------
Summary: Improve error messages of empty statement
Key: SPARK-38456
URL: https://issues.apache.org/jira/browse/SPARK-38456
Project: Spark
Issue Type: Sub-task
Components: SQL
Affects Versions: 3.3.0
Reporter: Xinyi Yu
Please view the parent task description for the general idea:
https://issues.apache.org/jira/browse/SPARK-38384
The empty statement is a special case of "mismatched input". Now it outputs
mismatched input '<EOF>' expecting.. which is long and tedious, doesn't provide
succinct information.
h2. Empty Statement
Before
{code:java}
ParseException:
mismatched input '<EOF>' expecting {'(', 'CONVERT', 'COPY', 'OPTIMIZE',
'RESTORE', 'ADD', 'ALTER', 'ANALYZE', 'CACHE', 'CLEAR', 'COMMENT', 'COMMIT',
'CREATE', 'DELETE', 'DESC', 'DESCRIBE', 'DFS', 'DROP', 'EXPLAIN', 'EXPORT',
'FROM', 'GRANT', 'IMPORT', 'INSERT', 'LIST', 'LOAD', 'LOCK', 'MAP', 'MERGE',
'MSCK', 'REDUCE', 'REFRESH', 'REPLACE', 'RESET', 'REVOKE', 'ROLLBACK',
'SELECT', 'SET', 'SHOW', 'START', 'TABLE', 'TRUNCATE', 'UNCACHE', 'UNLOCK',
'UPDATE', 'USE', 'VALUES', 'WITH'}(line 1, pos 0)
== SQL ==
^^^ {code}
After
{code:java}
ParseException:
Syntax error, unexpected empty statement (line 1, pos 0)
== SQL ==
^^^ {code}
Changes:
# For empty query, output a specific error message 'Syntax error, unexpected
empty statement'
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]