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/14 09:42:25 UTC

[GitHub] [shardingsphere] lanchengx opened a new pull request, #16824: `SHOW SHARDING TABLE RULE` syntax doc

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

   For #16666 .
   
   Changes proposed in this pull request:
   - Add `SHOW SHARDING TABLE RULE` syntax 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 #16824: `SHOW SHARDING TABLE RULE` syntax doc

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


##########
docs/document/content/reference/distsql/syntax/rql/rule-query/show-sharding-table-rule.cn.md:
##########
@@ -0,0 +1,84 @@
++++
+title = "SHOW SHARDING TABLE RULE"
+weight = 3
++++
+
+
+### 描述
+
+`SHOW SHARDING TABLE RULE` 语法用于查询指定逻辑库中的分片规则。
+
+### 语法
+```
+ShowShardingTableRule ::=
+  'SHOW' 'SHARDING' 'TABLE' ('RULE' tableName | 'RULES') ('FROM' schemaName)?
+
+tableName ::=
+  identifier
+
+schemaName ::=
+  identifier
+```
+
+### 补充说明
+- 未指定 `schemaName` 时,默认是当前使用的 `SCHEMA`。 如果也未使用 `SCHEMA` 则会提示 `No database selected`。
+
+ ### 返回值说明
+
+| 列                                | 说明                                |
+| --------------------------------- | ---------------------------------- |
+| table                             | 逻辑表名                            |
+| actual_data_nodes                 | 实际的数据节点                       |
+| actual_data_sources               | 实际的数据源(通过 RDL 创建的规则时显示)|
+| database_strategy_type            | 数据库分片策略类型                    |
+| database_sharding_column          | 数据库分片键                         |
+| database_sharding_algorithm_type  | 数据库分片算法类型                    |
+| database_sharding_algorithm_props | 数据库分片算法参数                    |
+| table_strategy_type               | 表分片策略类型                       |
+| table_sharding_column             | 表分片键                            |
+| table_sharding_algorithm_type     | 表分片算法类型                       |
+| table_sharding_algorithm_props    | 表分片算法参数                       |
+| key_generate_column               | 分布式主键生成列                     |
+| key_generator_type                | 分布式主键生成器类型                  |
+| key_generator_props               | 分布式主键生成器参数                  |
+
+ ### 示例
+- 查询指定逻辑库的分片规则
+```sql
+SHOW SHARDING TABLE RULES FROM example_db;

Review Comment:
   Use `sharding_db` uniformly



-- 
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 #16824: `SHOW SHARDING TABLE RULE` syntax doc

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


-- 
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 #16824: `SHOW SHARDING TABLE RULE` syntax doc

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


##########
docs/document/content/reference/distsql/syntax/rql/rule-query/show-sharding-table-rule.en.md:
##########
@@ -0,0 +1,84 @@
++++
+title = "SHOW SHARDING TABLE RULE"
+weight = 3
++++
+
+
+### Description
+
+The `SHOW SHARDING TABLE RULE` syntax is used to query the sharding table rule in the specified schema.
+
+### Syntax
+```
+ShowShardingTableRule ::=
+  'SHOW' 'SHARDING' 'TABLE' ('RULE' tableName | 'RULES') ('FROM' schemaName)?
+
+tableName ::=
+  identifier
+
+schemaName ::=
+  identifier
+```
+
+### Supplement
+- When `schemaName` is not specified, the default is the currently used `SCHEMA`. If `SCHEMA` is also not used, `No database selected` will be prompted.
+
+ ### Return value description
+
+| Column                            | Description                                               |
+| --------------------------------- | --------------------------------------------------------- |
+| table                             | Logical table name                                        |
+| actual_data_nodes                 | Actual data node                                          |
+| actual_data_sources               | Actual data source (Displayed when creating rules by RDL) |
+| database_strategy_type            | Database sharding strategy type                           |
+| database_sharding_column          | Database sharding column                                  |
+| database_sharding_algorithm_type  | Database sharding algorithm type                          |
+| database_sharding_algorithm_props | Database sharding algorithm properties                    |
+| table_strategy_type               | Table sharding strategy type                              |
+| table_sharding_column             | Table sharding column                                     |
+| table_sharding_algorithm_type     | Table sharding algorithm type                             |
+| table_sharding_algorithm_props    | Table sharding algorithm properties                       |
+| key_generate_column               | Sharding key generator column                             |
+| key_generator_type                | Sharding key generator type                               |
+| key_generator_props               | Sharding key generator properties                         |
+
+ ### Example
+- Query the sharding table rule of the specified logical schema

Review Comment:
   rule -> rules



-- 
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 #16824: `SHOW SHARDING TABLE RULE` syntax doc

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


##########
docs/document/content/reference/distsql/syntax/rql/rule-query/show-sharding-table-rule.en.md:
##########
@@ -0,0 +1,84 @@
++++
+title = "SHOW SHARDING TABLE RULE"
+weight = 3
++++
+
+
+### Description
+
+The `SHOW SHARDING TABLE RULE` syntax is used to query the sharding table rule in the specified schema.
+
+### Syntax
+```
+ShowShardingTableRule ::=
+  'SHOW' 'SHARDING' 'TABLE' ('RULE' tableName | 'RULES') ('FROM' schemaName)?
+
+tableName ::=
+  identifier
+
+schemaName ::=
+  identifier
+```
+
+### Supplement
+- When `schemaName` is not specified, the default is the currently used `SCHEMA`. If `SCHEMA` is also not used, `No database selected` will be prompted.

Review Comment:
   please remove `also`.



-- 
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 #16824: `SHOW SHARDING TABLE RULE` syntax doc

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


##########
docs/document/content/reference/distsql/syntax/rql/rule-query/show-sharding-table-rule.cn.md:
##########
@@ -0,0 +1,84 @@
++++
+title = "SHOW SHARDING TABLE RULE"
+weight = 3
++++
+
+
+### 描述
+
+`SHOW SHARDING TABLE RULE` 语法用于查询指定逻辑库中的分片规则。
+
+### 语法
+```
+ShowShardingTableRule ::=
+  'SHOW' 'SHARDING' 'TABLE' ('RULE' tableName | 'RULES') ('FROM' schemaName)?
+
+tableName ::=
+  identifier
+
+schemaName ::=
+  identifier
+```
+
+### 补充说明
+- 未指定 `schemaName` 时,默认是当前使用的 `SCHEMA`。 如果也未使用 `SCHEMA` 则会提示 `No database selected`。
+
+ ### 返回值说明
+
+| 列                                | 说明                                |
+| --------------------------------- | ---------------------------------- |
+| table                             | 逻辑表名                            |
+| actual_data_nodes                 | 实际的数据节点                       |
+| actual_data_sources               | 实际的数据源(通过 RDL 创建的规则时显示)|
+| database_strategy_type            | 数据库分片策略类型                    |
+| database_sharding_column          | 数据库分片键                         |
+| database_sharding_algorithm_type  | 数据库分片算法类型                    |
+| database_sharding_algorithm_props | 数据库分片算法参数                    |
+| table_strategy_type               | 表分片策略类型                       |
+| table_sharding_column             | 表分片键                            |
+| table_sharding_algorithm_type     | 表分片算法类型                       |
+| table_sharding_algorithm_props    | 表分片算法参数                       |
+| key_generate_column               | 分布式主键生成列                     |
+| key_generator_type                | 分布式主键生成器类型                  |
+| key_generator_props               | 分布式主键生成器参数                  |
+
+ ### 示例
+- 查询指定逻辑库的分片规则
+```sql
+SHOW SHARDING TABLE RULES FROM example_db;
+```
+```sql
++--------------+----------------------------+---------------------+------------------------+--------------------------+----------------------------------+----------------------------------------+---------------------+-----------------------+-------------------------------+-----------------------------------------+---------------------+--------------------+---------------------+
+| table        | actual_data_nodes          | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props      | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props          | key_generate_column | key_generator_type | key_generator_props |
++--------------+----------------------------+---------------------+------------------------+--------------------------+----------------------------------+----------------------------------------+---------------------+-----------------------+-------------------------------+-----------------------------------------+---------------------+--------------------+---------------------+
+| t_order      | ds_${0..1}.t_order_${0..1} |                     | inline                 | user_id                  | inline                           | algorithm-expression=ds_${user_id % 2} | inline              | user_id               | inline                        | algorithm-expression=ds_${order_id % 2} |                     |                    |                     |
+| t_order_item | ds_${0..1}.t_order_${0..1} |                     | inline                 | user_id                  | inline                           | algorithm-expression=ds_${user_id % 2} | inline              | user_id               | inline                        | algorithm-expression=ds_${order_id % 2} |                     |                    |                     |

Review Comment:
   `actual_data_nodes` is wrong for `t_order_item`



-- 
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 #16824: `SHOW SHARDING TABLE RULE` syntax doc

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


##########
docs/document/content/reference/distsql/syntax/rql/rule-query/show-sharding-table-rule.cn.md:
##########
@@ -0,0 +1,84 @@
++++
+title = "SHOW SHARDING TABLE RULE"
+weight = 3
++++
+
+
+### 描述
+
+`SHOW SHARDING TABLE RULE` 语法用于查询指定逻辑库中的分片规则。
+
+### 语法
+```
+ShowShardingTableRule ::=
+  'SHOW' 'SHARDING' 'TABLE' ('RULE' tableName | 'RULES') ('FROM' schemaName)?
+
+tableName ::=
+  identifier
+
+schemaName ::=
+  identifier
+```
+
+### 补充说明
+- 未指定 `schemaName` 时,默认是当前使用的 `SCHEMA`。 如果也未使用 `SCHEMA` 则会提示 `No database selected`。
+
+ ### 返回值说明
+
+| 列                                | 说明                                |
+| --------------------------------- | ---------------------------------- |
+| table                             | 逻辑表名                            |
+| actual_data_nodes                 | 实际的数据节点                       |
+| actual_data_sources               | 实际的数据源(通过 RDL 创建的规则时显示)|
+| database_strategy_type            | 数据库分片策略类型                    |
+| database_sharding_column          | 数据库分片键                         |
+| database_sharding_algorithm_type  | 数据库分片算法类型                    |
+| database_sharding_algorithm_props | 数据库分片算法参数                    |
+| table_strategy_type               | 表分片策略类型                       |
+| table_sharding_column             | 表分片键                            |
+| table_sharding_algorithm_type     | 表分片算法类型                       |
+| table_sharding_algorithm_props    | 表分片算法参数                       |
+| key_generate_column               | 分布式主键生成列                     |
+| key_generator_type                | 分布式主键生成器类型                  |
+| key_generator_props               | 分布式主键生成器参数                  |
+
+ ### 示例
+- 查询指定逻辑库的分片规则
+```sql
+SHOW SHARDING TABLE RULES FROM example_db;
+```
+```sql
++--------------+----------------------------+---------------------+------------------------+--------------------------+----------------------------------+----------------------------------------+---------------------+-----------------------+-------------------------------+-----------------------------------------+---------------------+--------------------+---------------------+
+| table        | actual_data_nodes          | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props      | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props          | key_generate_column | key_generator_type | key_generator_props |
++--------------+----------------------------+---------------------+------------------------+--------------------------+----------------------------------+----------------------------------------+---------------------+-----------------------+-------------------------------+-----------------------------------------+---------------------+--------------------+---------------------+
+| t_order      | ds_${0..1}.t_order_${0..1} |                     | inline                 | user_id                  | inline                           | algorithm-expression=ds_${user_id % 2} | inline              | user_id               | inline                        | algorithm-expression=ds_${order_id % 2} |                     |                    |                     |
+| t_order_item | ds_${0..1}.t_order_${0..1} |                     | inline                 | user_id                  | inline                           | algorithm-expression=ds_${user_id % 2} | inline              | user_id               | inline                        | algorithm-expression=ds_${order_id % 2} |                     |                    |                     |
++--------------+----------------------------+---------------------+------------------------+--------------------------+----------------------------------+----------------------------------------+---------------------+-----------------------+-------------------------------+-----------------------------------------+---------------------+--------------------+---------------------+
+2 rows in set (0.01 sec)
+```
+
+- 查询当前逻辑库的分片规则
+```sql
+SHOW SHARDING TABLE RULES;
+```
+```sql
++--------------+----------------------------+---------------------+------------------------+--------------------------+----------------------------------+----------------------------------------+---------------------+-----------------------+-------------------------------+-----------------------------------------+---------------------+--------------------+---------------------+
+| table        | actual_data_nodes          | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props      | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props          | key_generate_column | key_generator_type | key_generator_props |
++--------------+----------------------------+---------------------+------------------------+--------------------------+----------------------------------+----------------------------------------+---------------------+-----------------------+-------------------------------+-----------------------------------------+---------------------+--------------------+---------------------+
+| t_order      | ds_${0..1}.t_order_${0..1} |                     | inline                 | user_id                  | inline                           | algorithm-expression=ds_${user_id % 2} | inline              | user_id               | inline                        | algorithm-expression=ds_${order_id % 2} |                     |                    |                     |
+| t_order_item | ds_${0..1}.t_order_${0..1} |                     | inline                 | user_id                  | inline                           | algorithm-expression=ds_${user_id % 2} | inline              | user_id               | inline                        | algorithm-expression=ds_${order_id % 2} |                     |                    |                     |
++--------------+----------------------------+---------------------+------------------------+--------------------------+----------------------------------+----------------------------------------+---------------------+-----------------------+-------------------------------+-----------------------------------------+---------------------+--------------------+---------------------+
+2 rows in set (0.01 sec)
+```
+- 查询指定的分片规则

Review Comment:
   '查询指定`逻辑表`的分片规则' may be better.



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