[GitHub] [incubator-shardingsphere] tristaZero commented on issue #3914: Optimization for Sharing Parser with ANTLR Visitor for MySQL
tristaZero commented on issue #3914: Optimization for Sharing Parser with ANTLR Visitor for MySQL URL: https://github.com/apache/incubator-shardingsphere/issues/3914#issuecomment-585579405 Hi congrats to everyone, we basically finish the parser opimization for MySQL! 磊 The parser opimization for other databases is our next step and then we will consider transferring our sharding parser from old one to the one we are working, which seems a great challenge for us, go ahead! 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero commented on issue #3914: Optimization for Sharing Parser with Antlr Visitor
tristaZero commented on issue #3914: Optimization for Sharing Parser with Antlr Visitor URL: https://github.com/apache/incubator-shardingsphere/issues/3914#issuecomment-584988939 > revoke-user Hi, thanks for your feedback, done. 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero commented on issue #3914: Optimization for Sharing Parser with Antlr Visitor
tristaZero commented on issue #3914: Optimization for Sharing Parser with Antlr Visitor URL: https://github.com/apache/incubator-shardingsphere/issues/3914#issuecomment-584987022 Hi, @dongzl @beijing-penguin @tianbin1001 @SteNicholas @jingshanglu Could you update the status of [status1](https://github.com/apache/incubator-shardingsphere/issues/3914#issuecomment-581108911) and [status2](https://github.com/apache/incubator-shardingsphere/issues/3914#issuecomment-583220969) if you have made some progress? 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero commented on issue #3914: Optimization for Sharing Parser with Antlr Visitor
tristaZero commented on issue #3914: Optimization for Sharing Parser with Antlr Visitor URL: https://github.com/apache/incubator-shardingsphere/issues/3914#issuecomment-583220969 Here are some remaining task from my position, MySQL visitor progress: - DAL **(In charge of @jingshanglu)** - [ ] Optimizations points from #4117 - [ ] set - [ ] show - DCL **(in the charge of @tianbin1001 and @beijing-penguin)** - [ ] alter-login - [ ] alter-role - [ ] create-login - [ ] deny-user - [ ] drop-login - [ ] grant-user - [ ] revoke-user - [ ] set-role - DDL **(in the charge of @SteNicholas)** - [ ] Consider to simply `visitCreateTable` in `MySQLDDLVisitor` - [ ] Consider to simply `visitAlterTable` in `MySQLDDLVisitor` - [ ] Consider to simply `createColumnDefinitionSegment` in `MySQLDDLVisitor` - DML **(in the charge of @tristaZero)** - [ ] long-sql - [ ] select - [ ] select-aggregate - [ ] select-expression - [ ] select-group-by - [ ] select-join - [ ] select-or - [ ] select-order-by - [ ] select-pagination - [ ] select-pagination-group-by-order-by - [ ] select-sub-query - TCL **(in the charge of @dongzl )** Congrats for you! 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: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero commented on issue #3914: Optimization for Sharing Parser with Antlr Visitor
tristaZero commented on issue #3914: Optimization for Sharing Parser with Antlr Visitor URL: https://github.com/apache/incubator-shardingsphere/issues/3914#issuecomment-574108748 ## Here is instruction ### Tasks: 1. Add rule visitors in `MySQLVisitor.java` based on g4 files[1]. 2. Check whether rule name in g4 files is appropriate or not. 3. Add parsed integrated test for your **new main rule visitor**. ### Task detail: 1. Add rule visitors 1.1 Since `MySQLVisitor.java` extends `MySQLStatementBaseVisitor.java`, you should overwrite `visitRuleName(ctx)` from `MySQLStatementBaseVisitor` referring to rules in g4 files. 1.2 When adding `visitRuleName(ctx)`, you should put it below the corresponding note generally named `xxx.g4` and keep its order same with where it is in `xxx.g4` file. 1.3 What we need after parsing is those classes implement `SQLStatemnt` interface, so you should parse all necessary rules (add necessary rule visitors) making up `the main rules` in `MySQLStatement.g4`, and then fill necessary `segments` to `xxxSQLStatemnt`. 2.Check rule name 2.1 If we do not care one rule (do not add visitor for it), its name should end up with `_` in g4 file. For instance, we do not add visitor for `IDENTIFIER_` in `baseRule.g4`. 2.2 Otherwise this rule name should not contain `_` in the end. 2.3 If existing rule name does not accord with the above rules, please fix it. 3. Add parsed integrated test When you successfully add `one main rule visitor`, adding parsed integrated test for it is necessary. 3.1 Copy sql case you need from `./incubator-shardingsphere/sharding-sql-test/src/main/resources/sql/sharding/` to `./incubator-shardingsphere/sharding-sql-test/src/main/resources/sql/visitor/` (`Please note to keep the same directory`). 3.2 Copy the corresponding sql parsed result from `./incubator-shardingsphere/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sharding/` to ` ./incubator-shardingsphere/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/visitor/` (`Please note to keep the same directory`). 3.3 Run `org.apache.shardingsphere.sql.parser.integrate.engine.visitor.VisitorParameterizedParsingTest`. 3.4 If there is no sql case you need in `./incubator-shardingsphere/sharding-sql-test/src/main/resources/sql/sharding/`, please record it to this issue[2]. P.S, my suggestion is to easily test its parsed result previously. ### Examples 1. Current functions in `org.apache.shardingsphere.sql.parser.MySQLVisitor` could provide examples for you. 2. You could learn more the parsed integrated test from test entrance `org.apache.shardingsphere.sql.parser.integrate.engine.visitor.VisitorParameterizedParsingTest`. ### Notice 1. This guideline applys to `OracleVisitor`, `PostrgreSQLVisitor`, `SQLServerVisitor` and `SQL92Visitor` as well. [1] DALStatement.g4, DCLStatement.g4, DDLStatement.g4, DMLStatement.g4, TCLStatement.g4 and StoreProcedure.g4 [2] https://github.com/apache/incubator-shardingsphere/issues/3967 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: us...@infra.apache.org With regards, Apache Git Services