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/01/07 09:30:47 UTC

[GitHub] [shardingsphere] jingshanglu opened a new issue #8935: support "show sharding rule "

jingshanglu opened a new issue #8935:
URL: https://github.com/apache/shardingsphere/issues/8935


   ## Feature Request
   add support `show sharding rule`.
   
   ### Describe the feature you would like.
   support `show sharding rule`, and the result like this:
   +-------------+------------------+--------------------------------+---------------------------+--------------------------+-------------------+
   | tables      | bindingTables|defaultDatabaseStrategy| defaultTableStrategy|shardingAlgorithms |keyGenerators |
   +-------------+------------------+--------------------------------+---------------------------+--------------------------+-------------------+
   | xxxx        | xxxxx             | xxx                                 | xxx                            | xxx                         |xxxx                  |
   +------------+-------------------+--------------------------------+---------------------------+--------------------------+-------------------+


----------------------------------------------------------------
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 issue #8935: support "show sharding rule "

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


   ```yaml
   
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: ds_${0..1}.t_order_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_inline
         keyGenerateStrategy:
           column: order_id
           keyGeneratorName: snowflake
       t_order_item:
         actualDataNodes: ds_${0..1}.t_order_item_${0..1}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_item_inline
         keyGenerateStrategy:
           column: order_item_id
           keyGeneratorName: snowflake
     bindingTables:
       - t_order,t_order_item
     defaultDatabaseStrategy:
       standard:
         shardingColumn: user_id
         shardingAlgorithmName: database_inline
     defaultTableStrategy:
       none:
       
   
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 2}
       t_order_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_${order_id % 2}
       t_order_item_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item_${order_id % 2}
   
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 123
   ```
   
   **Convert to**
   
   ```sql
   name                t_order         
   actualDataNodes     ds_${0..1}.t_order_${0..1}          
   tableStrategy       shardingColumn=order_id t_order_inline(algorithm-expression=t_order_${order_id % 2})
   databaseStrategy    shardingColumn=user_id database_inline(algorithm-expression=ds_${user_id % 2}))
   keyGenerateStrategy column=order_id snowflake(worker-id=123)
   bindingTable        t_order_item
   ----
   name                t_order_item
   actualDataNodes     ds_${0..1}.t_order_item_${0..1}          
   tableStrategy       shardingColumn=order_id t_order_item_inline(algorithm-expression=t_order_item_${order_id % 2})
   databaseStrategy    shardingColumn=user_id database_inline(algorithm-expression=ds_${user_id % 2}))
   keyGenerateStrategy column=order_item_id snowflake(worker-id=123)
   bindingTable        t_order
   ```


----------------------------------------------------------------
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 closed issue #8935: support "show sharding rule "

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


   


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