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 2021/09/27 01:16:47 UTC

[GitHub] [shardingsphere] CrackerSuperior opened a new issue #12754: How does autotable recognize the use of sharding algorithms?

CrackerSuperior opened a new issue #12754:
URL: https://github.com/apache/shardingsphere/issues/12754


   In the official example, I am a little confused, the configuration file is as follows:
   ``` yaml
   schemaName: logic_db
   
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: jdbc_${0..1}.t_order_${0..1}
       t_order_item:
         actualDataNodes: jdbc_${0..1}.t_order_item_${0..1}
         keyGenerateStrategy:
           column: item_id
           keyGeneratorName: increment
       t_config:
         actualDataNodes: jdbc_${0..1}.t_config
       t_user:
         actualDataNodes: jdbc_0.t_user_${0..1}
         tableStrategy:
           standard:
             shardingColumn: id
             shardingAlgorithmName: table_inline
         keyGenerateStrategy:
           column: id
           keyGeneratorName: reset_increment
     autoTables:
       t_order_auto:
         actualDataSources: jdbc_0, jdbc_1
         shardingStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: mod
       t_order_item_auto:
         shardingStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: mod
     bindingTables:
       - t_order,t_order_item
     broadcastTables:
       - t_config
     defaultTableStrategy:
       standard:
         shardingColumn: order_id
         shardingAlgorithmName: standard_test
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: standard_test
     
     shardingAlgorithms:
       standard_test:
           type: STANDARD_TEST
       table_inline:
         type: INLINE
         props:
           algorithm-expression: t_user_${id % 2}
       mod:
         type: MOD
         props:
           sharding-count: 2
     
     keyGenerators:
       increment:
         type: INCREMENT
       reset_increment:
         type: RESET_INCREMENT
   ```
   I don't understand how this t_order uses t_order_auto. Does it just use name recognition?


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] CrackerSuperior closed issue #12754: How does autotable recognize the use of sharding algorithms?

Posted by GitBox <gi...@apache.org>.
CrackerSuperior closed issue #12754:
URL: https://github.com/apache/shardingsphere/issues/12754


   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #12754: How does autotable recognize the use of sharding algorithms?

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #12754:
URL: https://github.com/apache/shardingsphere/issues/12754#issuecomment-927448926


   > I don't understand how this t_order uses t_order_auto. Does it just use name recognition?
   
   `t_order_auto` is another logic table, not related to `t_order`. 
   `tables` and `autoTables` are different sharding configuration ways, just choose one.
   
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] yx9o commented on issue #12754: How does autotable recognize the use of sharding algorithms?

Posted by GitBox <gi...@apache.org>.
yx9o commented on issue #12754:
URL: https://github.com/apache/shardingsphere/issues/12754#issuecomment-927433768


   @CaymanHK Hi, please refer here: https://mp.weixin.qq.com/s/fDYqW-yJIVpkcUDNT-gsuA.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] CrackerSuperior commented on issue #12754: How does autotable recognize the use of sharding algorithms?

Posted by GitBox <gi...@apache.org>.
CrackerSuperior commented on issue #12754:
URL: https://github.com/apache/shardingsphere/issues/12754#issuecomment-927450468


   > > I don't understand how this t_order uses t_order_auto. Does it just use name recognition?
   > 
   > `t_order_auto` is another logic table, not related to `t_order`.
   > `tables` and `autoTables` are different sharding configuration ways, just choose one.
   
   oh! That's it, thank 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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] yx9o edited a comment on issue #12754: How does autotable recognize the use of sharding algorithms?

Posted by GitBox <gi...@apache.org>.
yx9o edited a comment on issue #12754:
URL: https://github.com/apache/shardingsphere/issues/12754#issuecomment-927433768


   @CrackerSuperior Hi, please refer here: https://mp.weixin.qq.com/s/fDYqW-yJIVpkcUDNT-gsuA.


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] CrackerSuperior commented on issue #12754: How does autotable recognize the use of sharding algorithms?

Posted by GitBox <gi...@apache.org>.
CrackerSuperior commented on issue #12754:
URL: https://github.com/apache/shardingsphere/issues/12754#issuecomment-927436244


   > @CrackerSuperior Hi, please refer here: https://mp.weixin.qq.com/s/fDYqW-yJIVpkcUDNT-gsuA.
   
   ``` yaml
   autoTables:
     t_order:
       # 指定使用的数据源
       actualDataSources: ds_${0..7}
       shardingStrategy:
         standard:
           shardingColumn: order_id
           shardingAlgorithmName: mod
   shardingAlgorithms:
     mod:
       type: MOD
       props:
         # 指定分片数量
         sharding-count: 32
   ```
   The example in the article also has "shardingAlgorithmName:mod" to refer to the "shardingAlgorithm" of "mod", but the above example does not seem to have this


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org