You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/10/19 15:12:11 UTC

[GitHub] [shardingsphere] strongduanmu opened a new pull request #7853: support create and drop view refresh meta data

strongduanmu opened a new pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853


   Ref #7138.
   
   Changes proposed in this pull request:
   - support create and drop view refresh meta data
   - modify routing way of function and procedure statements to all databases route
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-io commented on pull request #7853: support mysql create and drop view refresh meta data

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853#issuecomment-712271562


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7853?src=pr&el=h1) Report
   > Merging [#7853](https://codecov.io/gh/apache/shardingsphere/pull/7853?src=pr&el=desc) into [master](https://codecov.io/gh/apache/shardingsphere/commit/8c41e756b58cf10b38a6916106dc347a4c34d82d?el=desc) will **decrease** coverage by `0.04%`.
   > The diff coverage is `51.38%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/7853/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so)](https://codecov.io/gh/apache/shardingsphere/pull/7853?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #7853      +/-   ##
   ============================================
   - Coverage     75.01%   74.96%   -0.05%     
     Complexity      532      532              
   ============================================
     Files          1425     1428       +3     
     Lines         22571    22643      +72     
     Branches       4042     4056      +14     
   ============================================
   + Hits          16931    16975      +44     
   - Misses         4548     4571      +23     
   - Partials       1092     1097       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/7853?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [.../route/engine/type/ShardingRouteEngineFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctcm91dGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NoYXJkaW5nL3JvdXRlL2VuZ2luZS90eXBlL1NoYXJkaW5nUm91dGVFbmdpbmVGYWN0b3J5LmphdmE=) | `71.42% <0.00%> (-3.04%)` | `0.00 <0.00> (ø)` | |
   | [...phere/infra/binder/SQLStatementContextFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtYmluZGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9iaW5kZXIvU1FMU3RhdGVtZW50Q29udGV4dEZhY3RvcnkuamF2YQ==) | `9.83% <0.00%> (-0.34%)` | `0.00 <0.00> (ø)` | |
   | [...inder/statement/ddl/AlterViewStatementContext.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtYmluZGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9iaW5kZXIvc3RhdGVtZW50L2RkbC9BbHRlclZpZXdTdGF0ZW1lbnRDb250ZXh0LmphdmE=) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...binder/statement/ddl/DropViewStatementContext.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtYmluZGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9iaW5kZXIvc3RhdGVtZW50L2RkbC9Ecm9wVmlld1N0YXRlbWVudENvbnRleHQuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (?)` | |
   | [...gsphere/sql/parser/mysql/visitor/MySQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1teXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9teXNxbC92aXNpdG9yL015U1FMVmlzaXRvci5qYXZh) | `79.29% <0.00%> (-1.36%)` | `1.00 <0.00> (ø)` | |
   | [...sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1teXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9teXNxbC92aXNpdG9yL2ltcGwvTXlTUUxERExWaXNpdG9yLmphdmE=) | `47.14% <0.00%> (-0.69%)` | `0.00 <0.00> (ø)` | |
   | [...r/sql/common/statement/ddl/AlterViewStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kZGwvQWx0ZXJWaWV3U3RhdGVtZW50LmphdmE=) | `100.00% <ø> (ø)` | `1.00 <0.00> (ø)` | |
   | [.../sql/common/statement/ddl/CreateViewStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kZGwvQ3JlYXRlVmlld1N0YXRlbWVudC5qYXZh) | `100.00% <ø> (ø)` | `1.00 <0.00> (ø)` | |
   | [...er/sql/common/statement/ddl/DropViewStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kZGwvRHJvcFZpZXdTdGF0ZW1lbnQuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00 <0.00> (ø)` | |
   | [...pl/CreateViewStatementMetaDataRefreshStrategy.java](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9yZWZyZXNoL2ltcGwvQ3JlYXRlVmlld1N0YXRlbWVudE1ldGFEYXRhUmVmcmVzaFN0cmF0ZWd5LmphdmE=) | `85.71% <85.71%> (ø)` | `0.00 <0.00> (?)` | |
   | ... and [14 more](https://codecov.io/gh/apache/shardingsphere/pull/7853/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7853?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7853?src=pr&el=footer). Last update [8c41e75...57dde13](https://codecov.io/gh/apache/shardingsphere/pull/7853?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on pull request #7853: support mysql create and drop view refresh meta data

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853#issuecomment-712519674


   /ci


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on a change in pull request #7853: support mysql create and drop view refresh meta data

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853#discussion_r508197439



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/impl/ShardingCreateProcedureStatementValidator.java
##########
@@ -42,7 +44,9 @@ public void preValidate(final ShardingRule shardingRule, final SQLStatementConte
         routineBodySegment.ifPresent(routineBody -> {
             TableExtractor extractor = new TableExtractor();
             validateTableNotExist(metaData, extractor.extractNotExistTableFromRoutineBody(routineBody));
-            validateShardingTable(metaData, extractor.extractExistTableFromRoutineBody(routineBody));
+            Collection<SimpleTableSegment> existTables = extractor.extractExistTableFromRoutineBody(routineBody);
+            validateShardingTable(metaData, existTables);

Review comment:
       Hi @strongduanmu 
   I know this PR is a time-consuming work, Very appreciated your initiative!
   `Create procedure, function, view` is a 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on a change in pull request #7853: support mysql create and drop view refresh meta data

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853#discussion_r508197439



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/impl/ShardingCreateProcedureStatementValidator.java
##########
@@ -42,7 +44,9 @@ public void preValidate(final ShardingRule shardingRule, final SQLStatementConte
         routineBodySegment.ifPresent(routineBody -> {
             TableExtractor extractor = new TableExtractor();
             validateTableNotExist(metaData, extractor.extractNotExistTableFromRoutineBody(routineBody));
-            validateShardingTable(metaData, extractor.extractExistTableFromRoutineBody(routineBody));
+            Collection<SimpleTableSegment> existTables = extractor.extractExistTableFromRoutineBody(routineBody);
+            validateShardingTable(metaData, existTables);

Review comment:
       Hi @strongduanmu 
   I know this PR is a time-consuming job, Very appreciated your initiative!
   `Create procedure, function, view` is a troublesome but user-liked issue that sometimes frustrates me to think about it. You are the pioneer for this challenging one, so I wish you could improve it step by step for a satisfying solution.
   At present, I can see the `create view` is narrowed to those single tables (no sharding tables, broadcast tables) , isn't it? It seems a critical first step for me, and I will give my +1 vote.
   However, here It looks like you enable `create function, procedure` on the sharding table as well, right? Do you think these SQL could work well on all the sharding tables and single tables? Or are there any restrictions?
   
   Look forward to hearing from you.
   
   Best,
   Trista




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #7853: support mysql create and drop view refresh meta data

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on a change in pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853#discussion_r508210067



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/validator/ddl/impl/ShardingCreateProcedureStatementValidator.java
##########
@@ -42,7 +44,9 @@ public void preValidate(final ShardingRule shardingRule, final SQLStatementConte
         routineBodySegment.ifPresent(routineBody -> {
             TableExtractor extractor = new TableExtractor();
             validateTableNotExist(metaData, extractor.extractNotExistTableFromRoutineBody(routineBody));
-            validateShardingTable(metaData, extractor.extractExistTableFromRoutineBody(routineBody));
+            Collection<SimpleTableSegment> existTables = extractor.extractExistTableFromRoutineBody(routineBody);
+            validateShardingTable(metaData, existTables);

Review comment:
       > Hi @strongduanmu
   > I know this PR is a time-consuming job, Very appreciated your initiative!
   > `Create procedure, function, view` is a troublesome but user-liked issue that sometimes frustrates me to think about it. You are the pioneer for this challenging one, so I wish you could improve it step by step for a satisfying solution.
   > At present, I can see the `create view` is narrowed to those single tables (no sharding tables, broadcast tables) , isn't it? It seems a critical first step for me, and I will give my +1 vote.
   > However, here It looks like you enable `create function, procedure` on the sharding table as well, right? Do you think these SQL could work well on all the sharding tables and single tables? Or are there any restrictions?
   > 
   > Look forward to hearing from you.
   > 
   > Best,
   > Trista
   
   @tristaZero The `create function` and `create procedure` statements have previously added a validator to limit the use of the sharding table. This pr is only to modify the routing way of the `create function` and `create procedure` statements and change it to all databases routing. 😂




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu removed a comment on pull request #7853: support mysql create and drop view refresh meta data

Posted by GitBox <gi...@apache.org>.
strongduanmu removed a comment on pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853#issuecomment-712519674


   /ci


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero merged pull request #7853: support mysql create and drop view refresh meta data

Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #7853:
URL: https://github.com/apache/shardingsphere/pull/7853


   


----------------------------------------------------------------
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:
users@infra.apache.org