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/11/17 09:15:42 UTC

[GitHub] [shardingsphere] menghaoranss commented on issue #13658: implements StandardShardingAlgorithm doSharding doesn't work

menghaoranss commented on issue #13658:
URL: https://github.com/apache/shardingsphere/issues/13658#issuecomment-971384304


   Please use `CLASS_BASED` type to configure custom sharding algorithm in 5.0.0 version:
   ```
   rules:
   - !SHARDING
     tables:
       t_order: 
         actualDataNodes: ds_${0..1}.t_order
         keyGenerateStrategy:
           column: order_id
           keyGeneratorName: snowflake
       t_order_item:
         actualDataNodes: ds_${0..1}.t_order_item
         keyGenerateStrategy:
           column: order_item_id
           keyGeneratorName: snowflake
     bindingTables:
       - t_order,t_order_item
     broadcastTables:
       - t_address
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: database_classbased
     defaultTableStrategy:
       none:
     
     shardingAlgorithms:
       database_classbased:
         type: CLASS_BASED
         props:
           strategy: standard
           algorithmClassName: org.apache.shardingsphere.example.extension.sharding.algortihm.classbased.fixture.ClassBasedStandardShardingAlgorithmFixture
       
   ```


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