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/11/09 15:25:43 UTC

[GitHub] [shardingsphere] strongduanmu opened a new pull request #8105: support subquery route without sharding column

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


   Changes proposed in this pull request:
   - support subquery route without sharding column
   - support range sharding condition value
   


----------------------------------------------------------------
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 #8105: support subquery route without sharding column

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



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/SubqueryRouteTest.java
##########
@@ -149,16 +149,6 @@ public void assertSubqueryForBinding() {
         assertRoute(sql, parameters);
     }
     
-    @Test(expected = IllegalStateException.class)
-    public void assertSubqueryWithoutHint() {
-        List<Object> parameters = new LinkedList<>();
-        parameters.add(1);
-        parameters.add(2);
-        parameters.add(5);
-        String sql = "select count(*) from t_hint_test where user_id = (select t_hint_test from t_hint_test where user_id in (?,?,?)) ";
-        assertRoute(sql, parameters);
-    }
-    

Review comment:
       > @strongduanmu Why delete this UT?
   
   @jingshanglu After we support sub query route without sharding key, this exception case will not exist. 




----------------------------------------------------------------
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 #8105: support subquery route without sharding column

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


   


----------------------------------------------------------------
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 #8105: support subquery route without sharding column

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


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/8105?src=pr&el=h1) Report
   > Merging [#8105](https://codecov.io/gh/apache/shardingsphere/pull/8105?src=pr&el=desc) (b3c5fc2) into [master](https://codecov.io/gh/apache/shardingsphere/commit/b13473fbea001a4b827ff415d493e556dd64cc98?el=desc) (b13473f) will **increase** coverage by `0.10%`.
   > The diff coverage is `54.16%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/8105/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so)](https://codecov.io/gh/apache/shardingsphere/pull/8105?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #8105      +/-   ##
   ============================================
   + Coverage     75.06%   75.17%   +0.10%     
     Complexity      548      548              
   ============================================
     Files          1450     1448       -2     
     Lines         22743    22717      -26     
     Branches       4060     4057       -3     
   ============================================
   + Hits          17073    17078       +5     
   + Misses         4557     4525      -32     
   - Partials       1113     1114       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/8105?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...phere/sharding/route/engine/ShardingSQLRouter.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctcm91dGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NoYXJkaW5nL3JvdXRlL2VuZ2luZS9TaGFyZGluZ1NRTFJvdXRlci5qYXZh) | `72.05% <44.44%> (-5.37%)` | `1.00 <0.00> (ø)` | |
   | [...rser/sql/common/util/SafeNumberOperationUtils.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3V0aWwvU2FmZU51bWJlck9wZXJhdGlvblV0aWxzLmphdmE=) | `74.28% <60.00%> (+1.26%)` | `0.00 <0.00> (ø)` | |
   | [...pl/AlterTableStatementMetaDataRefreshStrategy.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9zY2hlbWEvcmVmcmVzaC9pbXBsL0FsdGVyVGFibGVTdGF0ZW1lbnRNZXRhRGF0YVJlZnJlc2hTdHJhdGVneS5qYXZh) | `80.00% <0.00%> (-7.50%)` | `0.00% <0.00%> (ø%)` | |
   | [...ext/transaction/GovernanceTransactionContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS1jb3JlLWNvbnRleHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29udGV4dC90cmFuc2FjdGlvbi9Hb3Zlcm5hbmNlVHJhbnNhY3Rpb25Db250ZXh0cy5qYXZh) | `93.33% <0.00%> (-6.67%)` | `0.00% <0.00%> (ø%)` | |
   | [...sctl/explain/ShardingCTLExplainBackendHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L3NjdGwvZXhwbGFpbi9TaGFyZGluZ0NUTEV4cGxhaW5CYWNrZW5kSGFuZGxlci5qYXZh) | `75.00% <0.00%> (-0.87%)` | `0.00% <0.00%> (ø%)` | |
   | [...ingsphere/governance/core/config/ConfigCenter.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS1jb3JlLWNvbmZpZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZ292ZXJuYW5jZS9jb3JlL2NvbmZpZy9Db25maWdDZW50ZXIuamF2YQ==) | `76.03% <0.00%> (-0.39%)` | `0.00% <0.00%> (ø%)` | |
   | [...ere/driver/executor/PreparedStatementExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9leGVjdXRvci9QcmVwYXJlZFN0YXRlbWVudEV4ZWN1dG9yLmphdmE=) | `95.65% <0.00%> (-0.19%)` | `1.00% <0.00%> (ø%)` | |
   | [...ce/core/config/listener/SchemaChangedListener.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS1jb3JlLWNvbmZpZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZ292ZXJuYW5jZS9jb3JlL2NvbmZpZy9saXN0ZW5lci9TY2hlbWFDaGFuZ2VkTGlzdGVuZXIuamF2YQ==) | `93.47% <0.00%> (-0.14%)` | `0.00% <0.00%> (ø%)` | |
   | [...e/infra/route/engine/impl/AllSQLRouteExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtcm91dGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL3JvdXRlL2VuZ2luZS9pbXBsL0FsbFNRTFJvdXRlRXhlY3V0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
   | [...munication/DatabaseCommunicationEngineFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL0RhdGFiYXNlQ29tbXVuaWNhdGlvbkVuZ2luZUZhY3RvcnkuamF2YQ==) | `100.00% <0.00%> (ø)` | `0.00% <0.00%> (ø%)` | |
   | ... and [49 more](https://codecov.io/gh/apache/shardingsphere/pull/8105/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/8105?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/8105?src=pr&el=footer). Last update [b13473f...b3c5fc2](https://codecov.io/gh/apache/shardingsphere/pull/8105?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] jingshanglu commented on a change in pull request #8105: support subquery route without sharding column

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



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/standard/SubqueryRouteTest.java
##########
@@ -149,16 +149,6 @@ public void assertSubqueryForBinding() {
         assertRoute(sql, parameters);
     }
     
-    @Test(expected = IllegalStateException.class)
-    public void assertSubqueryWithoutHint() {
-        List<Object> parameters = new LinkedList<>();
-        parameters.add(1);
-        parameters.add(2);
-        parameters.add(5);
-        String sql = "select count(*) from t_hint_test where user_id = (select t_hint_test from t_hint_test where user_id in (?,?,?)) ";
-        assertRoute(sql, parameters);
-    }
-    

Review comment:
       @strongduanmu Why delete this UT?




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