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 2022/04/21 07:50:33 UTC

[GitHub] [shardingsphere] lanchengx opened a new pull request, #16979: Add `CREATE SHARDING BIDNING TABLE RULE` doc

lanchengx opened a new pull request, #16979:
URL: https://github.com/apache/shardingsphere/pull/16979

   For #16666 
   
   Changes proposed in this pull request:
   - `CREATE SHARDING BIDNING TABLE RULE` doc
   


-- 
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 a diff in pull request #16979: Add `CREATE SHARDING BIDNING TABLE RULE` doc

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #16979:
URL: https://github.com/apache/shardingsphere/pull/16979#discussion_r855717043


##########
docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.en.md:
##########
@@ -26,13 +26,20 @@ tableName ::=
 
 ### Example
 
-#### Create a binding table rule
+#### 1.Create a binding table rule
 
 ```sql
 -- Before creating a binding table rule, you need to create a sharding table t_order, t_order_item
 CREATE SHARDING BINDING TABLE RULES (t_order,t_order_item);
 ```
 
+#### 2.Create multiple binding table rule

Review Comment:
   `rules` for multiple.



-- 
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 a diff in pull request #16979: Add `CREATE SHARDING BIDNING TABLE RULE` doc

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #16979:
URL: https://github.com/apache/shardingsphere/pull/16979#discussion_r855328502


##########
docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-binding-table-rule.cn.md:
##########
@@ -0,0 +1,39 @@
++++
+title = "CREATE SHARDING BINDING TABLE RULE"
+weight = 3
++++
+
+## 描述
+
+`CREATE SHARDING BINDING TABLE RULE` 语法用于为具有分片规则的表(分片表)添加绑定关系
+
+### 语法定义
+
+```SQL
+CreateBindingTableRule ::=
+  'CREATE' 'SHARDING' 'BINDING' 'TABLE' 'RULES' '(' tableName (',' tableName)* ')'
+
+tableName ::=
+  identifier
+```
+
+### 补充说明
+
+- 只有分片表才能创建绑定关系
+- 一个分片表只能具有一个绑定关系
+- 添加绑定关系的分片表需要使用相同的资源,并且分片节点个数相同。例如 `ds_${0..1}.t_order_${0..1}` 与 `ds_${0..1}.t_order_item_${0..1}`
+- 添加绑定关系的分片表需要对分片键使用相同的分片算法。例如 `t_order_${order_id % 2}` 与 `t_order_item_${order_item_id % 2}` 
+
+### 示例
+
+#### 创建绑定关系
+
+```sql
+-- 创建绑定关系之前需要先创建分片表 t_order,t_order_item
+CREATE SHARDING BINDING TABLE RULES (t_order,t_order_item);

Review Comment:
   How to create multiple groups of binding tables



-- 
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 merged pull request #16979: Add `CREATE SHARDING BIDNING TABLE RULE` doc

Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #16979:
URL: https://github.com/apache/shardingsphere/pull/16979


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