[ 
https://issues.apache.org/jira/browse/SPARK-38456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xinyi Yu updated SPARK-38456:
-----------------------------
    Description: 
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" (See 
https://issues.apache.org/jira/browse/SPARK-38385 for more details). 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'

 

  was:
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'

 


> 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
>            Priority: Major
>
> 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" (See 
> https://issues.apache.org/jira/browse/SPARK-38385 for more details). 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: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to