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/01/14 13:23:11 UTC

[GitHub] [incubator-shardingsphere] devefx opened a new issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

devefx opened a new issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977
 
 
   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/incubator-shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response **more than 7 days** and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   4.0.0
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   
   Sharding-JDBC
   
   ### Expected behavior
   
   ```yml
   my_table:
     database-strategy:
       none:
         any: 1
   ```
   
   ```java
   public class YamlShardingStrategyConfiguration implements YamlConfiguration {
       
       private YamlStandardShardingStrategyConfiguration standard;
       
       private YamlComplexShardingStrategyConfiguration complex;
       
       private YamlHintShardingStrategyConfiguration hint;
       
       private YamlInlineShardingStrategyConfiguration inline;
       
       private YamlNoneShardingStrategyConfiguration none; // no null
   }
   ```
   
   ### Actual behavior
   
   
   ```java
   public class YamlShardingStrategyConfiguration implements YamlConfiguration {
       
       private YamlStandardShardingStrategyConfiguration standard;
       
       private YamlComplexShardingStrategyConfiguration complex;
       
       private YamlHintShardingStrategyConfiguration hint;
       
       private YamlInlineShardingStrategyConfiguration inline;
       
       private YamlNoneShardingStrategyConfiguration none; // is null
   }
   ```
   
   ### Reason analyze (If you can)
   
   `org.apache.shardingsphere.core.yaml.config.sharding.strategy.YamlNoneShardingStrategyConfiguration`  There must be a field, like `private boolean enabled;`
   
   ```yml
   my_table:
     database-strategy:
       none:
         enabled: true
   ```
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   ### Example codes for reproduce this issue (such as a github link).
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-574638367
 
 
   ![image](https://user-images.githubusercontent.com/15070360/72433886-4b5a6b00-37d5-11ea-809f-d2b055a70875.png)
   
   ```java
   package org.apache.shardingsphere.core.yaml.config.sharding.strategy;
   
   import lombok.Data;
   
   @Data
   public final class YamlNoneShardingStrategyConfiguration implements YamlBaseShardingStrategyConfiguration {
   
       private boolean enabled;
   }
   ```
   This is me override
   
   
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-574638323
 
 
   Sorry, picture is not full configuration and quite inconvenient.
   Please paste congfiguration as a text to comment.
   You can remove some important data like username,password,url and so on.

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-574636807
 
 
   ![image](https://user-images.githubusercontent.com/15070360/72433673-d71fc780-37d4-11ea-8ded-29d2b987ea71.png)
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-574633976
 
 
   > @devefx Can you try to use?
   > 
   > ```yaml
   > my_table:
   >   database-strategy:
   >     none: {}
   > ```
   
   Still not working, a field must be included

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-575499975
 
 
   I will close this issue because create and describe in new issue#4005.
   
   If has more discussion or solution, please move to #4005.

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-574545912
 
 
   @devefx Can you try to use? 
   ```yaml
   my_table:
     database-strategy:
       none: {}
   ```

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-575016348
 
 
   Add a field? like `private boolean enabled;`

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-574635787
 
 
   For my test,
   
   ```yaml
   my_table:
     database-strategy:
       none: {}
   ```
   
   This configuration can work. 
   
   Can you provide your full sharding configuration? Or example code?
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-575017307
 
 
   > Add a field? like `private boolean enabled;`
   
   Not a good idea, the NoneStrategy already means do nothing. If set a sub field `enabled`, Is it means a true switch when `enabled=true`? I think it will confuse users.

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-574496158
 
 
   Why do you set sub configure for none strategy?

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
KomachiSion commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-575014564
 
 
   I find the problem is caused by springboot. 
   springboot parse yaml and transfer to propertySource. At this time, springboot would ignore some item.
   
   I'm not sure whether there are some configuration so that springboot do not ignore them.

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] KomachiSion closed issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
KomachiSion closed issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977
 
 
   

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


With regards,
Apache Git Services

[GitHub] [incubator-shardingsphere] devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml

Posted by GitBox <gi...@apache.org>.
devefx commented on issue #3977: The sharding-JDBC non-sharding policy, NoneShardingStrategy, does not work in yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3977#issuecomment-574639640
 
 
   This my configuration
   
   ```yml
     shardingsphere:
       datasource:
         names: default, marketdata
         default:
           xxxx
         marketdata:
           xxx
       props:
         sql:
           show: true
       sharding:
         default-data-source-name: default
         default-database-strategy:
           standard:
             sharding-column: uid
             precise-algorithm-class-name: my.shardingsphere.strategy.DatabasePreciseShardingAlgorithm
         default-table-strategy:
           standard:
             sharding-column: uid
             precise-algorithm-class-name: my.shardingsphere.strategy.TablePreciseShardingAlgorithm
         tables:
           price_index:
             actual-data-nodes: marketdata.price_index
             database-strategy:
               none: {}
             table-strategy:
               none: {}
   
   ```

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


With regards,
Apache Git Services