jingshanglu opened a new issue #6480:
URL: https://github.com/apache/shardingsphere/issues/6480


   Hi community,
   
   This issue is to collate the SQL definitions of Oracle. **Therefore, we can 
support parsing more SQLs**. 
   We need your interaction! If you 
   
   > 1. Be familiar with `g4 file` of Antlr (The grammars are 
RegularExpression-like)
   > 2. Understand the `Oracle grammars`
   
   then welcome!
   
   ### Background
   
   **How is a SQL parsed?**
   `SQL definition file` 
   ->(Parse to) 
   `AST`
   ->(Visit it)  
   `SQLStatment`  
   
   
   
   
   ### Process
   
   1. Compare `SQL definitions` in [Oficial SQL 
Doc](https://docs.oracle.com/en/database/oracle/oracle-database/18/lnpls/plsql-language-elements.html#GUID-285DFAEE-1A34-4248-BA4B-2591476A0C3C)
 and [ShardingSphere SQL 
Doc](https://github.com/apache/shardingsphere/tree/master/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle)
   2. If there is any difference in ShardingSphere SQL Doc, please correct them 
referring to Official SQL Doc
   3. Run `mvn install the current_file_module` 
   4. Check whether there are any exceptions. If indeed, please fix them. 
(Especially `xxxVisitor.class`)
   5. Add new corresponding SQL case in [SQL 
Cases](https://github.com/apache/shardingsphere/tree/master/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/supported)
 and expected parsed result in [Expected Statment 
XML](https://github.com/apache/shardingsphere/tree/master/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/main/resources/case)
   6. Run 
[SQLParserParameterizedTest](https://github.com/apache/shardingsphere/blob/master/shardingsphere-sql-parser/shardingsphere-sql-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
     : ...
     ;
   ```
   
   2. [Here](https://shimo.im/docs/WrgrCt9JR3JDjq8H/read) is a Chinese version 
for reference.
   
   ### subtask
   
   - [ ] select
   - [ ] update
   - [ ] insert
   - [ ] delete


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

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


Reply via email to