You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by ji...@apache.org on 2022/10/19 06:46:18 UTC

[shardingsphere] branch master updated: Update DistSql rql documents (#21644)

This is an automated email from the ASF dual-hosted git repository.

jianglongtao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new c0f6a1c52dc Update DistSql rql documents (#21644)
c0f6a1c52dc is described below

commit c0f6a1c52dc53d5c882a1985a80d7c60907e0269
Author: Qianyi951015 <57...@users.noreply.github.com>
AuthorDate: Wed Oct 19 14:46:10 2022 +0800

    Update DistSql rql documents (#21644)
    
    * Update RQL documents
    
    * Update RQL documents
    
    * Update RQL documents
---
 .../sharding/create-sharding-auditor.cn.md         |  4 +-
 .../sharding/show-sharding-auditors.cn.md          | 73 +++++++++++++++++++++
 .../sharding/show-sharding-auditors.en.md          | 74 ++++++++++++++++++++++
 .../sharding/show-sharding-table-nodes.cn.md       | 72 +++++++++++++++++++++
 .../sharding/show-sharding-table-nodes.en.md       | 73 +++++++++++++++++++++
 .../sharding/show-unused-sharding-auditors.cn.md   | 73 +++++++++++++++++++++
 .../sharding/show-unused-sharding-auditors.en.md   | 74 ++++++++++++++++++++++
 .../show-unused-sharding-key-generators.cn.md      | 73 +++++++++++++++++++++
 .../show-unused-sharding-key-generators.en.md      | 74 ++++++++++++++++++++++
 9 files changed, 588 insertions(+), 2 deletions(-)

diff --git a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-auditor.cn.md b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-auditor.cn.md
index b4d1530df8e..011ef0ee787 100644
--- a/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-auditor.cn.md
+++ b/docs/document/content/reference/distsql/syntax/rdl/rule-definition/sharding/create-sharding-auditor.cn.md
@@ -5,12 +5,12 @@ weight = 8
 
 ## 描述
 
-`CREATE SHARDING AUDITOR` 语法用于为当前所选的逻辑库添加分片审计生成器
+`CREATE SHARDING AUDITOR` 语法用于为当前所选的逻辑库添加分片审计器
 
 ### 语法定义
 
 ```sql
-CreateShardingAlgorithm ::=
+CreateShardingAuditor ::=
   'CREATE' 'SHARDING' 'AUDITOR' auditorName '(' algorithmDefinition ')'
 
 algorithmDefinition ::=
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-auditors.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-auditors.cn.md
new file mode 100644
index 00000000000..744248f8f66
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-auditors.cn.md
@@ -0,0 +1,73 @@
++++
+title = "SHOW SHARDING AUDITORS"
+weight = 8
++++
+
+### 描述
+
+`SHOW SHARDING AUDITORS` 语法用于查询指定逻辑库中的分片审计器。
+
+### 语法
+
+```
+ShowShardingAuditors::=
+  'SHOW' 'SHARDING' 'AUDITOR'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列                      | 说明          |
+| -----------------------|---------------|
+| name                   | 分片审计器名称  |
+| type                   | 分片审计算法类型 |
+| props                  | 分片审计算法参数 |
+
+### 示例
+
+- 查询指定逻辑库中的分片审计器
+
+```sql
+SHOW SHARDING AUDITORS FROM test1;
+```
+
+```sql
+mysql> SHOW SHARDING AUDITORS FROM test1;
++-------------------------------+-------------------------+-------+
+| name                          | type                    | props |
++-------------------------------+-------------------------+-------+
+| sharding_key_required_auditor | dml_sharding_conditions | {}    |
++-------------------------------+-------------------------+-------+
+1 row in set (0.01 sec)
+```
+
+- 查询当前逻辑库中的分片审计器
+
+```sql
+SHOW SHARDING AUDITORS;
+```
+
+```sql
+mysql> SHOW SHARDING AUDITORS;
++-------------------------------+-------------------------+-------+
+| name                          | type                    | props |
++-------------------------------+-------------------------+-------+
+| sharding_key_required_auditor | dml_sharding_conditions | {}    |
++-------------------------------+-------------------------+-------+
+1 row in set (0.00 sec)
+```
+
+### 保留字
+
+`SHOW`、`SHARDING`、`AUDITORS`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-auditors.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-auditors.en.md
new file mode 100644
index 00000000000..be0a3e4c854
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-auditors.en.md
@@ -0,0 +1,74 @@
++++
+title = "SHOW SHARDING AUDITORS"
+weight = 8
+
++++
+
+### Description
+
+`SHOW SHARDING AUDITORS` syntax is used to query sharding auditors in specified database.
+
+### Syntax
+
+```
+ShowShardingAuditors::=
+  'SHOW' 'SHARDING' 'AUDITOR'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### Supplement
+
+- When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.
+
+### Return value description
+
+| column                 | Description                           |
+| -----------------------|---------------------------------------|
+| name                   | Sharding auditor name                 |
+| type                   | Sharding auditor algorithm type       |
+| props                  | Sharding auditor algorithm properties |
+
+### Example
+
+- Query sharding auditors for the specified logical database
+
+```sql
+SHOW SHARDING AUDITORS FROM test1;
+```
+
+```sql
+mysql> SHOW SHARDING AUDITORS FROM test1;
++-------------------------------+-------------------------+-------+
+| name                          | type                    | props |
++-------------------------------+-------------------------+-------+
+| sharding_key_required_auditor | dml_sharding_conditions | {}    |
++-------------------------------+-------------------------+-------+
+1 row in set (0.01 sec)
+```
+
+- Query sharding auditors for the current logical database
+
+```sql
+SHOW SHARDING AUDITORS;
+```
+
+```sql
+mysql> SHOW SHARDING AUDITORS;
++-------------------------------+-------------------------+-------+
+| name                          | type                    | props |
++-------------------------------+-------------------------+-------+
+| sharding_key_required_auditor | dml_sharding_conditions | {}    |
++-------------------------------+-------------------------+-------+
+1 row in set (0.00 sec)
+```
+
+### Reserved word
+
+`SHOW`、`SHARDING`、`AUDITORS`、`FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-nodes.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-nodes.cn.md
new file mode 100644
index 00000000000..d886f8f3251
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-nodes.cn.md
@@ -0,0 +1,72 @@
++++
+title = "SHOW SHARDING TABLE NODES"
+weight = 10
++++
+
+### 描述
+
+`SHOW SHARDING TABLE NODES` 语法用于查询指定逻辑库中的分片表的节点分布。
+
+### 语法
+
+```
+ShowShardingTableNode::=
+  'SHOW' 'SHARDING' 'TABLE' 'NODE'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列     | 说明          |
+| ------| --------------|
+| name  | 分片规则名称    |
+| nodes | 分片节点       |
+
+### 示例
+
+- 查询指定逻辑库中的分片表的节点分布
+
+```sql
+SHOW SHARDING TABLE NODES FROM test1;
+```
+
+```sql
+mysql> SHOW SHARDING TABLE NODES FROM test1;
++--------------+------------------------------------------------------------------------------------------------------------+
+| name         | nodes                                                                                                      |
++--------------+------------------------------------------------------------------------------------------------------------+
+| t_order_item | resource_0.t_order_item_0, resource_0.t_order_item_1, resource_1.t_order_item_0, resource_1.t_order_item_1 |
++--------------+------------------------------------------------------------------------------------------------------------+
+1 row in set (0.00 sec)
+```
+
+- 查询当前逻辑库中的分片表的节点分布
+
+```sql
+SHOW SHARDING TABLE NODES;
+```
+
+```sql
+mysql> SHOW SHARDING TABLE NODES;
++--------------+------------------------------------------------------------------------------------------------------------+
+| name         | nodes                                                                                                      |
++--------------+------------------------------------------------------------------------------------------------------------+
+| t_order_item | resource_0.t_order_item_0, resource_0.t_order_item_1, resource_1.t_order_item_0, resource_1.t_order_item_1 |
++--------------+------------------------------------------------------------------------------------------------------------+
+1 row in set (0.00 sec)
+```
+
+### 保留字
+
+`SHOW`、`SHARDING`、`TABLE`、`NODE`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-nodes.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-nodes.en.md
new file mode 100644
index 00000000000..3446c674591
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-sharding-table-nodes.en.md
@@ -0,0 +1,73 @@
++++
+title = "SHOW SHARDING TABLE NODES"
+weight = 10
+
++++
+
+### Description
+
+`SHOW SHARDING TABLE NODES` syntax is used to query sharding table nodes in specified database.
+
+### Syntax
+
+```
+ShowShardingTableNode::=
+  'SHOW' 'SHARDING' 'TABLE' 'NODE'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### Supplement
+
+- When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.
+
+### Return value description
+
+| Columns     | Descriptions       |
+| ------------| -------------------|
+| name        | Sharding rule name |
+| nodes       | Sharding nodes     |
+
+### Example
+
+- Query sharding table nodes for the specified logical database
+
+```sql
+SHOW SHARDING TABLE NODES FROM test1;
+```
+
+```sql
+mysql> SHOW SHARDING TABLE NODES FROM test1;
++--------------+------------------------------------------------------------------------------------------------------------+
+| name         | nodes                                                                                                      |
++--------------+------------------------------------------------------------------------------------------------------------+
+| t_order_item | resource_0.t_order_item_0, resource_0.t_order_item_1, resource_1.t_order_item_0, resource_1.t_order_item_1 |
++--------------+------------------------------------------------------------------------------------------------------------+
+1 row in set (0.00 sec)
+```
+
+- Query sharding table nodes for the current logical database
+
+```sql
+SHOW SHARDING TABLE NODES;
+```
+
+```sql
+mysql> SHOW SHARDING TABLE NODES;
++--------------+------------------------------------------------------------------------------------------------------------+
+| name         | nodes                                                                                                      |
++--------------+------------------------------------------------------------------------------------------------------------+
+| t_order_item | resource_0.t_order_item_0, resource_0.t_order_item_1, resource_1.t_order_item_0, resource_1.t_order_item_1 |
++--------------+------------------------------------------------------------------------------------------------------------+
+1 row in set (0.00 sec
+```
+
+### Reserved word
+
+`SHOW`、`SHARDING`、`TABLE`、`NODE`、`FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-auditors.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-auditors.cn.md
new file mode 100644
index 00000000000..522dc091ef9
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-auditors.cn.md
@@ -0,0 +1,73 @@
++++
+title = "SHOW UNUSED SHARDING AUDITORS"
+weight = 9
++++
+
+### 描述
+
+`SHOW UNUSED SHARDING AUDITORS` 语法用于查询指定逻辑库中未被使用的分片审计器。
+
+### 语法
+
+```
+ShowUnusedShardingAuditors::=
+  'SHOW' 'SHARDING' 'AUDITOR'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列                      | 说明          |
+| -----------------------|---------------|
+| name                   | 分片审计器名称  |
+| type                   | 分片审计算法类型 |
+| props                  | 分片审计算法参数 |
+
+### 示例
+
+- 查询指定逻辑库中未被使用的分片审计器
+
+```sql
+SHOW UNUSED SHARDING AUDITORS FROM test1;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING AUDITORS FROM test1;
++-------------------------------+-------------------------+-------+
+| name                          | type                    | props |
++-------------------------------+-------------------------+-------+
+| sharding_key_required_auditor | dml_sharding_conditions | {}    |
++-------------------------------+-------------------------+-------+
+1 row in set (0.00 sec)
+```
+
+- 查询当前逻辑库中未被使用的的分片审计器
+
+```sql
+SHOW UNUSED SHARDING AUDITORS;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING AUDITORS;
++-------------------------------+-------------------------+-------+
+| name                          | type                    | props |
++-------------------------------+-------------------------+-------+
+| sharding_key_required_auditor | dml_sharding_conditions | {}    |
++-------------------------------+-------------------------+-------+
+1 row in set (0.00 sec)
+```
+
+### 保留字
+
+`SHOW`、`UNUSED`、`SHARDING`、`AUDITORS`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-auditors.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-auditors.en.md
new file mode 100644
index 00000000000..dbfe07b5a77
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-auditors.en.md
@@ -0,0 +1,74 @@
++++
+title = "SHOW UNUSED SHARDING AUDITORS"
+weight = 9
+
++++
+
+### Description
+
+`SHOW SHARDING AUDITORS` syntax is used to query sharding auditors that are not used in specified database.
+
+### Syntax
+
+```
+ShowUnusedShardingAuditors::=
+  'SHOW' 'SHARDING' 'AUDITOR'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### Supplement
+
+- When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.
+
+### Return value description
+
+| column                 | Description                           |
+| -----------------------|---------------------------------------|
+| name                   | Sharding auditor name                 |
+| type                   | Sharding auditor algorithm type       |
+| props                  | Sharding auditor algorithm properties |
+
+### Example
+
+- Query sharding auditors that are not used in the specified logical database
+
+```sql
+SHOW SHARDING AUDITORS FROM test1;
+```
+
+```sql
+mysql> SHOW SHARDING AUDITORS FROM test1;
++-------------------------------+-------------------------+-------+
+| name                          | type                    | props |
++-------------------------------+-------------------------+-------+
+| sharding_key_required_auditor | dml_sharding_conditions | {}    |
++-------------------------------+-------------------------+-------+
+1 row in set (0.01 sec)
+```
+
+- Query sharding auditors are not used in the current logical database
+
+```sql
+SHOW UNUSED SHARDING AUDITORS FROM test1;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING AUDITORS FROM test1;
++-------------------------------+-------------------------+-------+
+| name                          | type                    | props |
++-------------------------------+-------------------------+-------+
+| sharding_key_required_auditor | dml_sharding_conditions | {}    |
++-------------------------------+-------------------------+-------+
+1 row in set (0.00 sec)
+```
+
+### Reserved word
+
+`SHOW`、`UNUSED`、`SHARDING`、`AUDITORS`、`FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-key-generators.cn.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-key-generators.cn.md
new file mode 100644
index 00000000000..0f8be14f26e
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-key-generators.cn.md
@@ -0,0 +1,73 @@
++++
+title = "SHOW UNUSED SHARDING KEY GENERATORS"
+weight = 7
++++
+
+### 描述
+
+`SHOW UNUSED SHARDING KEY GENERATORS` 语法用于查询指定逻辑库中未被使用的分布式主键生成器。
+
+### 语法
+
+```
+ShowUnusedShardingKeyGenerators::=
+  'SHOW' 'UNUSED' 'SHARDING' 'KEY' 'GENERATOR'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### 补充说明
+
+- 未指定 `databaseName` 时,默认是当前使用的 `DATABASE`。 如果也未使用 `DATABASE` 则会提示 `No database selected`。
+
+### 返回值说明
+
+| 列                      | 说明                 |
+| -----------------------| ---------------------|
+| name                   | 分布式主键生成器名称    |
+| type                   | 分布式主键生成器类型    |
+| props                  | 分布式主键生成器参数    |
+
+### 示例
+
+- 查询指定逻辑库中未被使用的分布式主键生成器
+
+```sql
+SHOW UNUSED SHARDING KEY GENERATORS FROM test1;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING KEY GENERATORS FROM test1;
++-------------------------+-----------+-------+
+| name                    | type      | props |
++-------------------------+-----------+-------+
+| snowflake_key_generator | snowflake |       |
++-------------------------+-----------+-------+
+1 row in set (0.01 sec)
+```
+
+- 查询当前逻辑库中未被使用的分布式主键生成器
+
+```sql
+SHOW UNUSED SHARDING KEY GENERATORS;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING KEY GENERATORS;
++-------------------------+-----------+-------+
+| name                    | type      | props |
++-------------------------+-----------+-------+
+| snowflake_key_generator | snowflake |       |
++-------------------------+-----------+-------+
+1 row in set (0.02 sec)
+```
+
+### 保留字
+
+`SHOW`、`UNUSED`、 `SHARDING`、`KEY`、`GENERATORS`、`FROM`
+
+### 相关链接
+
+- [保留字](/cn/reference/distsql/syntax/reserved-word/)
+
diff --git a/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-key-generators.en.md b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-key-generators.en.md
new file mode 100644
index 00000000000..c1fec77027a
--- /dev/null
+++ b/docs/document/content/reference/distsql/syntax/rql/rule-query/sharding/show-unused-sharding-key-generators.en.md
@@ -0,0 +1,74 @@
++++
+title = "SHOW UNUSED SHARDING KEY GENERATORS"
+weight = 7
+
++++
+
+### Description
+
+`SHOW SHARDING KEY GENERATORS` syntax is used to query sharding key generators that are not used in specified database.
+
+### Syntax
+
+```
+ShowShardingKeyGenerators::=
+  'SHOW' 'SHARDING' 'KEY' 'GENERATOR'('FROM' databaseName)?
+
+databaseName ::=
+  identifier
+```
+
+### Supplement
+
+- When databaseName is not specified, the default is the currently used DATABASE. If DATABASE is not used, No database selected will be prompted.
+
+### Return value description
+
+| column                 | Description                          |
+| -----------------------| -------------------------------------|
+| name                   | Sharding key generator name          |
+| type                   | Sharding key generator type          |
+| props                  | Sharding key generator properties    |
+
+### Example
+
+- Query sharding key generators that are not used in the specified logical database
+
+```sql
+SHOW UNUSED SHARDING KEY GENERATORS FROM test1;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING KEY GENERATORS FROM test1;
++-------------------------+-----------+-------+
+| name                    | type      | props |
++-------------------------+-----------+-------+
+| snowflake_key_generator | snowflake |       |
++-------------------------+-----------+-------+
+1 row in set (0.00 sec)
+```
+
+- Query sharding key generators that are not used in the current logical database
+
+```sql
+SHOW UNUSED SHARDING KEY GENERATORS;
+```
+
+```sql
+mysql> SHOW UNUSED SHARDING KEY GENERATORS;
++-------------------------+-----------+-------+
+| name                    | type      | props |
++-------------------------+-----------+-------+
+| snowflake_key_generator | snowflake |       |
++-------------------------+-----------+-------+
+1 row in set (0.00 sec)
+```
+
+### Reserved word
+
+`SHOW`、`UNUSED`、`SHARDING`、`KEY`、`GENERATORS`、`FROM`
+
+### Related links
+
+- [Reserved word](/en/reference/distsql/syntax/reserved-word/)
+