tuichenchuxin opened a new issue, #18948:
URL: https://github.com/apache/shardingsphere/issues/18948

   ## Feature Request
   
   ### Is your feature request related to a problem?
    No
   ### Describe the feature you would like.
    parse error should have detail info.
   like this sql 
   ```
   CREATE TABLE public.files (id BIGINT NOT NULL, created_at TIMESTAMP WITHOUT 
TIME ZONE, updated_at TIMESTAMP WITHOUT TIME ZONE, created_by BIGINT, 
updated_by BIGINT, name VARCHAR(255), path VARCHAR(255), CONSTRAINT files_pkey 
PRIMARY KEY (id))
   ```
   We can only get this error info
   ```
   You have an error in your SQL syntax
   ```
   Actually we can get detail info like this 
   ```
   line 1:184 no viable alternative at input 'path'
   ```
   ### How to do
   I found if I remove this error listener line. Then, I can get error info . 
So it's may be a way to get detail info.
   ```java
       @SneakyThrows(ReflectiveOperationException.class)
       private static SQLParser createSQLParser(final TokenStream tokenStream, 
final Class<? extends SQLParser> parserClass) {
           SQLParser result = 
parserClass.getConstructor(TokenStream.class).newInstance(tokenStream);
           ((Parser) result).setErrorHandler(new BailErrorStrategy());
           // ((Parser) 
result).removeErrorListener(ConsoleErrorListener.INSTANCE);
           return result;
       }
   ```


-- 
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]

Reply via email to