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


   Hi community,
   There are some unsupported sql in [this 
file](https://github.com/apache/shardingsphere/blob/master/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/unsupported/unsupported.xml)
   You can help to support if you
   >Be familiar with g4 file of Antlr (The grammars are RegularExpression-like)
   Be familiar with java 
   
   ## Background
   How is a SQL parsed?
   `SQL definition file`
   ->(Parse to)
   `AST`
   ->(Visit it)
   `SQLStatment`
   
   ## Process
   - Pick an unsupported sql and try to get why it's not supported.(antlr4 
grammer? or not implement visit method. You can use [antlr4 
plugins](https://plugins.jetbrains.com/plugin/7358-antlr-v4) to help 
analysis.You may need to visit offical doc to check the grammer.)
   - After you fixing it, remember to add new corresponding SQL case in [SQL 
Cases](https://github.com/apache/shardingsphere/tree/master/shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported)
 and expected parsed result in [Expected Statment 
XML](https://github.com/apache/shardingsphere/tree/master/shardingsphere-test/shardingsphere-parser-test/src/main/resources/case)
   - Run 
[SQLParserParameterizedTest](https://github.com/apache/shardingsphere/blob/master/shardingsphere-test/shardingsphere-parser-test/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/engine/SQLParserParameterizedTest.java)
 to make sure no exceptions.
   ## Notice
   1.Left recursion can not work well in Antlr4,
   ```
   a
     : b
     | a b
     ;
   b
     : a c
     ;
   c
     : ...
     ;
   ```
   you can consider the following one,
   ```
   a
     : b*
     ;
   b
     : a c
     ;
   c
     : ...
     ;
   ```
   [Here](https://shimo.im/docs/WrgrCt9JR3JDjq8H/read) is a Chinese version for 
reference.
   
   ## Sub Task
   
   - [ ] assert_select_into_SQL
   - [ ] assert_select_with_collate_with_marker
   - [ ] assert_select_with_json_extract_sign_with_parameter_marker
   - [ ] assert_select_with_json_unquote_extract_sign_with_parameter_marker
   - [ ] assert_insert_with_first
   - [ ] assert_dist_SQL_show_rule_parse_conflict
   - [ ] create_bit_xor_table
   - [ ] select_with_comment1
   - [ ] select_with_comment2
   - [ ] select_with_comment5
   - [ ] select_with_comment6
   - [ ] select_with_comment7
   - [ ] select_with_comment8
   - [ ] select_with_comment9
   - [ ] select_with_comment10
   - [x] alter_table_convert
   - [x] alter_table_convert_collate
   - [x] delimiter
   - [ ] with_select
   - [ ] with_select_comment
   - [ ] select_cast
   - [x] copy_table_from_stdin
   - [x] create_type
   - [ ] create_aggregate
   - [ ] create_table_as_select
   - [ ] create_schema
   - [ ] alter_aggregate
   - [x] create_conversion
   - [x] alter_conversion
   - [ ] create_foreign_data_wrapper
   - [ ] create_server
   - [ ] alter_foreign_data_wrapper
   - [x] create_language
   - [x] alter_language
   - [ ] create_operator
   - [ ] alter_operator
   - [ ] create_statistics
   - [ ] alter_statistics
   - [x] create_text_search_dictionary
   - [x] alter_text_search_dictionary
   - [x] create_text_search_template
   - [x] alter_text_search_template
   - [x] create_tex_search_parser
   - [x] alter_text_search_parser
   - [ ] drop_foreign_data_wrapper
   - [x] drop_language
   - [ ] drop_schema
   - [ ] drop_operator
   - [ ] comment_on_table
   - [ ] alter_view_rename
   - [ ] create_table_no_valid
   - [x] create_rule
   - [ ] drop_rule
   - [ ] create_as_select
   - [ ] create_domain
   - [x] drop_domain
   - [ ] create_temp_table
   - [ ] select_case_when
   - [ ] select_like
   - [ ] select_keyword
   - [ ] drop_type
   - [ ] alter_table_set
   - [ ] alter_view_set
   - [ ] create_publication
   


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