morrySnow commented on code in PR #1904: URL: https://github.com/apache/doris-website/pull/1904#discussion_r1942157995
########## docs/sql-manual/sql-statements/table-and-view/table/ALTER-COLOCATE-GROUP.md: ########## @@ -29,51 +29,53 @@ under the License. ## Description -This statement is used to modify the colocation group. +This statement is used to modify the properties of a Colocation Group. -Syntax: +## Syntax ```sql -ALTER COLOCATE GROUP [database.]group +ALTER COLOCATE GROUP [ <database.> ] <group_name> Review Comment: ```suggestion ALTER COLOCATE GROUP [ <database>. ] <group_name> ``` ########## docs/sql-manual/sql-statements/table-and-view/table/SHOW-PARTITIONS.md: ########## @@ -28,58 +28,134 @@ under the License. -## Description +## Descriptions - This statement is used to display partition information for tables in Internal catalog or Hive Catalog +This statement is used to display partition information. It supports both Internal catalog and Hive Catalog. -grammar: +For `Hive Catalog`: -```SQL - SHOW [TEMPORARY] PARTITIONS FROM [db_name.]table_name [WHERE] [ORDER BY] [LIMIT]; +It supports returning all partitions, including multi-level partitions. +## Syntax + +```sql +SHOW [ TEMPORARY ] PARTITIONS + FROM [ <db_name.> ] <table_name> Review Comment: ```suggestion FROM [ <db_name>. ] <table_name> ``` ########## docs/sql-manual/sql-statements/table-and-view/table/SHOW-COLUMNS.md: ########## @@ -28,25 +28,71 @@ under the License. ## Description -This statement is used to specify the column information of the table +This statement is used to specify the column information of a table. -grammar: +## Syntax ```sql -SHOW [FULL] COLUMNS FROM tbl; +SHOW [ <FULL> ] COLUMNS FROM <tbl>; ``` -## Example +## Required Parameters +**1. `<tbl>`** -1. View the column information of the specified table +The name of the table for which column information needs to be viewed must be specified. - ```sql - SHOW FULL COLUMNS FROM tbl; - ``` +## Optional Parameters +**1. `<FULL>`** -## Keywords +If the `FULL` keyword is specified, detailed information about the columns will be returned, including the aggregation type, permissions, comments, etc. of the columns. - SHOW, COLUMNS +## Return Value +| Column | DataType | Note | +|-|-|-------------------------| Review Comment: ```suggestion |--|--|-------------------------| ``` ########## docs/sql-manual/sql-statements/table-and-view/table/SHOW-DYNAMIC-PARTITION-TABLES.md: ########## @@ -24,27 +24,77 @@ specific language governing permissions and limitations under the License. --> -## Description +## Descriptions -This statement is used to display the status of all dynamic partition tables under the current db +This statement is used to display the status of all dynamic partition tables in the current database. -grammar: +## Syntax: ```sql -SHOW DYNAMIC PARTITION TABLES [FROM db_name]; +SHOW DYNAMIC PARTITION TABLES [ FROM <db_name> ]; ``` -## Example +## Required Parameters +**1. `<db_name>`** - 1. Display all dynamic partition table status of database database +pecify the `DB` name to display the status of dynamic partition tables. If not specified, the status of all dynamic partition tables in the current `DB` will be displayed by default. +## Return Value - ```sql - SHOW DYNAMIC PARTITION TABLES FROM database; - ``` +| Column | DataType | Note | +|------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| TableName | varchar | The name of the table in the current DB or the specified DB. | +| Enable | varchar | Whether the dynamic partition property of the table is enabled | +| TimeUnit | varchar | The partition granularity of the dynamic partition table, including `HOUR`, `DAY`, `WEEK`, `MONTH`, `YEAR`. | +| Start | varchar | The starting offset of the dynamic partition, which is a negative number. The default value is -2147483648, which means that historical partitions will not be deleted. Depending on the time_unit attribute, partitions with a range before this offset will be deleted based on the current day (week/month). | +| End | varchar | The ending offset of the dynamic partition, which is a positive number. Depending on the time_unit attribute, partitions within the corresponding range are created in advance based on the current day (week/month). | +| Prefix | varchar | The prefix of the dynamically created partition name. | +| Buckets | varchar | The number of buckets corresponding to the dynamically created partition. | +| ReplicationNum | varchar | The number of replicas corresponding to the dynamically created partition. If not specified, it defaults to the number of replicas specified when the table was created. | +| ReplicaAllocation | varchar | The replica distribution strategy corresponding to the dynamically created partition. If not specified, it defaults to the replica distribution strategy specified when the table was created. | +| StartOf | varchar | The starting point of each partition granularity for dynamic partitioning. When time_unit is WEEK, this field represents the starting point of each week, with values ranging from MONDAY to SUNDAY. When time_unit is MONTH, it represents the starting date of each month, with values ranging from 1rd to 28rd. When time_unit is MONTH, this value defaults to NULL. | +| LastUpdateTime | datetime | The last update time of the dynamic partition, which defaults to NULL. | +| LastSchedulerTime | datetime | The last scheduling time of the dynamic partition. | +| State | varchar | The state of the dynamic partition. | +| LastCreatePartitionMsg | varchar | The error message from the last execution of the dynamic partition addition scheduling. | +| LastDropPartitionMsg | varchar | The error message from the last execution of the dynamic partition deletion scheduling. | +| ReservedHistoryPeriods | varchar | The partition range of the historical partitions retained by the dynamic partition, which indicates which historical partitions should be retained in the dynamic partition table instead of being automatically deleted. | -## Keywords +## Access Control Requirements +1. If the parameter db_name is not specified, the status of all dynamic partition tables in the current DB will be displayed, and it is assumed that the user has the `SHOW_PRIV` privilege for the current DB by default. +2. If the parameter db_name is specified, the status of all dynamic partition tables in the specified DB will be displayed, and the user needs to have the `SHOW_PRIV` privilege for that DB. - SHOW, DYNAMIC, PARTITION +## Examples -## Best Practice +1. View the status of all dynamic partition tables in the current database: + + ```sql + SHOW DYNAMIC PARTITION TABLES; + ``` Review Comment: ````suggestion ```sql SHOW DYNAMIC PARTITION TABLES; ``` ```` ########## docs/sql-manual/sql-statements/table-and-view/table/ALTER-COLOCATE-GROUP.md: ########## @@ -29,51 +29,53 @@ under the License. ## Description -This statement is used to modify the colocation group. +This statement is used to modify the properties of a Colocation Group. -Syntax: +## Syntax ```sql -ALTER COLOCATE GROUP [database.]group +ALTER COLOCATE GROUP [ <database.> ] <group_name> SET ( - property_list + <property_list> ); ``` +## Required Parameters -NOTE: +**1. `<group_name>`** -1. If the colocate group is global, that is, its name starts with `__global__`, then it does not belong to any database; +Specify the name of the colocate group to be modified. -2. property_list is a colocation group attribute, currently only supports modifying `replication_num` and `replication_allocation`. After modifying these two attributes of the colocation group, at the same time, change the attribute `default.replication_allocation`, the attribute `dynamic.replication_allocation` of the table of the group, and the `replication_allocation` of the existing partition to be the same as it. +**2.`<property_list>`** -## Example +`property_list` is a property of the `colocation group`, and currently only supports modifying `replication_num` and `replication_allocation`. After modifying these two properties of the `colocation group`, simultaneously change the properties `default.replication_allocation`, `dynamic.replication_allocation`, and replication_allocation of the existing partitions of the group's tables to be the same as it. -1. Modify the number of copies of a global group +## Optional Parameters - ```sql - # Set "colocate_with" = "__global__foo" when creating the table - - ALTER COLOCATE GROUP __global__foo - SET ( - "replication_num"="1" - ); - ``` +**1. `<database>`** -2. Modify the number of copies of a non-global group +Specify the database to which the `colocate group` to be modified belongs. - ```sql - # Set "colocate_with" = "bar" when creating the table, and the Database is "example_db" - - ALTER COLOCATE GROUP example_db.bar - SET ( - "replication_num"="1" - ); - ``` +Note: +1. If the colocate group is global, that is, its name starts with __global__, then it does not belong to any Database -## Keywords +## Access Control Requirements +Requires `ADMIN` permissions. + +## Examples + +1. Modify the replica number of a global group, and set "colocate_with" = "__global__foo" when creating the table. Review Comment: ```suggestion 1. Modify the replica number of a global group, and set `"colocate_with" = "__global__foo"` when creating the table. ``` ########## docs/sql-manual/sql-statements/table-and-view/table/SHOW-COLUMNS.md: ########## @@ -28,25 +28,71 @@ under the License. ## Description -This statement is used to specify the column information of the table +This statement is used to specify the column information of a table. -grammar: +## Syntax ```sql -SHOW [FULL] COLUMNS FROM tbl; +SHOW [ <FULL> ] COLUMNS FROM <tbl>; ``` -## Example +## Required Parameters +**1. `<tbl>`** -1. View the column information of the specified table +The name of the table for which column information needs to be viewed must be specified. - ```sql - SHOW FULL COLUMNS FROM tbl; - ``` +## Optional Parameters +**1. `<FULL>`** Review Comment: ```suggestion **1. `FULL`** ``` ########## docs/sql-manual/sql-statements/table-and-view/table/SHOW-PARTITIONS.md: ########## @@ -28,58 +28,134 @@ under the License. -## Description +## Descriptions - This statement is used to display partition information for tables in Internal catalog or Hive Catalog +This statement is used to display partition information. It supports both Internal catalog and Hive Catalog. -grammar: +For `Hive Catalog`: -```SQL - SHOW [TEMPORARY] PARTITIONS FROM [db_name.]table_name [WHERE] [ORDER BY] [LIMIT]; +It supports returning all partitions, including multi-level partitions. +## Syntax + +```sql +SHOW [ TEMPORARY ] PARTITIONS + FROM [ <db_name.> ] <table_name> + [ <where_clause> ] + [ ORDER BY <order_by_key> ] + [ LIMIT <limit_rows> ]; ``` -illustrate: +## Required Parameters +**1. `<table_name>`** -When used in Internal catalog: +The name of the table for which partition information needs to be viewed must be specified. -1. Support the filtering of PartitionId, PartitionName, State, Buckets, ReplicationNum, LastConsistencyCheckTime and other columns -2. TEMPORARY specifies to list temporary partitions +## Optional Parameters +**1. `<TEMPORARY>`** Review Comment: ```suggestion **1. `TEMPORARY`** ``` ########## docs/sql-manual/sql-statements/table-and-view/table/SHOW-COLUMNS.md: ########## @@ -28,25 +28,71 @@ under the License. ## Description -This statement is used to specify the column information of the table +This statement is used to specify the column information of a table. -grammar: +## Syntax ```sql -SHOW [FULL] COLUMNS FROM tbl; +SHOW [ <FULL> ] COLUMNS FROM <tbl>; Review Comment: 参数需要加尖括号,关键字不需要 ```suggestion SHOW [ FULL ] COLUMNS FROM <tbl>; ``` -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org