From 71d533924b04df32081f9a6dd4dd15667749a259 Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 11:30:28 +0800 Subject: [PATCH 01/11] =?UTF-8?q?DESC=20TABLE=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Utility-Statements/DESCRIBE.md | 78 +++++++++++++------ .../Utility-Statements/DESCRIBE.md | 69 +++++++++++----- .../table-and-view/table/DESC-TABLE.md | 65 ++++++++++++---- .../table-and-view/table/DESC-TABLE.md | 64 +++++++++++---- .../table-and-view/table/DESC-TABLE.md | 68 ++++++++++++---- .../table-and-view/table/DESC-TABLE.md | 70 +++++++++++++---- 6 files changed, 313 insertions(+), 101 deletions(-) diff --git a/docs/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md b/docs/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md index 4eb2997b3340f..60e341f59788b 100644 --- a/docs/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md +++ b/docs/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md @@ -24,43 +24,75 @@ specific language governing permissions and limitations under the License. --> -## DESCRIBE +## Description -### Name +This statement is used to display the schema information of the specified table. -DESCRIBE - -### Description - -This statement is used to display the schema information of the specified table - -grammar: +## Syntax ```sql DESC[RIBE] [db_name.]table_name [ALL]; ``` -illustrate: +## Return Value -1. If ALL is specified, the schemas of all indexes (rollup) of the table will be displayed +| column name | description | +| -- |-----------------------------------| +| IndexName | Table name | +| IndexKeysType | Table Model | +| Field | Column Name | +| Type | Data Types | +| Null | Whether NULL values are allowed | +| Key | Is it a key column | +| Default | Default Value | +| Extra | Display some additional information | +| Visible | Visible | +| DefineExpr | Defining Expressions | +| WhereClause | Filter Conditions Related Definitions | -### Example +## Access Control Requirements -1. Display the Base table schema +Users executing this SQL command must have at least the following privileges: - ```sql - DESC table_name; - ``` +| Privilege | Object | Notes | +|:-------------|:----------|:----------------------------------------------------------------------------------------------| +| SELECT_PRIV | Table | When executing DESC, you need to have the SELECT_PRIV privilege on the table being queried | -2. Display the schema of all indexes of the table +## Usage Notes +If ALL is specified, the schema of all indexes (rollup) of the table is displayed. - ```sql - DESC db1.table_name ALL; - ``` -### Keywords +## Examples - DESCRIBE +1. Display the Base table schema + +```sql +DESC test_table; +``` +```text ++---------+-------------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------+-------------+------+-------+---------+-------+ +| user_id | bigint | No | true | NULL | | +| name | varchar(20) | Yes | false | NULL | NONE | +| age | int | Yes | false | NULL | NONE | ++---------+-------------+------+-------+---------+-------+ +``` + +2. Display the schema of all indexes in the table + +```sql +DESC demo.test_table ALL; +``` + +```text ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| IndexName | IndexKeysType | Field | Type | InternalType | Null | Key | Default | Extra | Visible | DefineExpr | WhereClause | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| test_table | DUP_KEYS | user_id | bigint | bigint | No | true | NULL | | true | | | +| | | name | varchar(20) | varchar(20) | Yes | false | NULL | NONE | true | | | +| | | age | int | int | Yes | false | NULL | NONE | true | | | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +``` -### Best Practice diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md index 59daf9036957f..fdc8469719ba2 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md @@ -24,43 +24,76 @@ specific language governing permissions and limitations under the License. --> -## DESCRIBE - -### Name - -DESCRIBE ## 描述 该语句用于展示指定 table 的 schema 信息 -语法: +## 语法 ```sql DESC[RIBE] [db_name.]table_name [ALL]; ``` -说明: +## 返回值 + +| 列名 | 说明 | +| -- |--------------| +| IndexName | 表名 | +| IndexKeysType | 表模型 | +| Field | 列名 | +| Type | 数据类型 | +| Null | 是否允许为 NULL 值 | +| Key | 是否为key列 | +| Default | 默认值 | +| Extra | 显示一些额外的信息 | +| Visible | 是否可见 | +| DefineExpr | 定义表达式 | +| WhereClause | 过滤条件 相关的定义 | + +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +|:--------------| :------------- |:---------------------------------------------| +| SELECT_PRIV | 表(Table) | 当执行 DESC 时,需要拥有被查询的表的 SELECT_PRIV 权限 | + +## 注意事项 +如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema -1. 如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema ## 举例 1. 显示Base表Schema - ```sql - DESC table_name; - ``` +```sql +DESC test_table; +``` +```text ++---------+-------------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------+-------------+------+-------+---------+-------+ +| user_id | bigint | No | true | NULL | | +| name | varchar(20) | Yes | false | NULL | NONE | +| age | int | Yes | false | NULL | NONE | ++---------+-------------+------+-------+---------+-------+ +``` 2. 显示表所有 index 的 schema - ```sql - DESC db1.table_name ALL; - ``` - -### Keywords +```sql +DESC demo.test_table ALL; +``` - DESCRIBE, DESC +```text ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| IndexName | IndexKeysType | Field | Type | InternalType | Null | Key | Default | Extra | Visible | DefineExpr | WhereClause | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| test_table | DUP_KEYS | user_id | bigint | bigint | No | true | NULL | | true | | | +| | | name | varchar(20) | varchar(20) | Yes | false | NULL | NONE | true | | | +| | | age | int | int | Yes | false | NULL | NONE | true | | | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +``` -### Best Practice diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md index d8b6c3bd36e53..67baed78ce53a 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md @@ -29,34 +29,69 @@ under the License. 该语句用于展示指定 table 的 schema 信息 -语法: +## 语法 ```sql DESC[RIBE] [db_name.]table_name [ALL]; ``` -说明: +## 返回值 -1. 如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema +| 列名 | 说明 | +| -- |--------------| +| IndexName | 表名 | +| IndexKeysType | 表模型 | +| Field | 列名 | +| Type | 数据类型 | +| Null | 是否允许为 NULL 值 | +| Key | 是否为key列 | +| Default | 默认值 | +| Extra | 显示一些额外的信息 | +| Visible | 是否可见 | +| DefineExpr | 定义表达式 | +| WhereClause | 过滤条件 相关的定义 | -## 示例 +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: -1. 显示 Base 表 Schema +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +|:--------------| :------------- |:---------------------------------------------| +| SELECT_PRIV | 表(Table) | 当执行 DESC 时,需要拥有被查询的表的 SELECT_PRIV 权限 | - ```sql - DESC table_name; - ``` +## 注意事项 +如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema -2. 显示表所有 index 的 schema - ```sql - DESC db1.table_name ALL; - ``` +## 举例 + +1. 显示Base表Schema -## 关键词 +```sql +DESC test_table; +``` +```text ++---------+-------------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------+-------------+------+-------+---------+-------+ +| user_id | bigint | No | true | NULL | | +| name | varchar(20) | Yes | false | NULL | NONE | +| age | int | Yes | false | NULL | NONE | ++---------+-------------+------+-------+---------+-------+ +``` - DESCRIBE, DESC +2. 显示表所有 index 的 schema -## 最佳实践 +```sql +DESC demo.test_table ALL; +``` +```text ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| IndexName | IndexKeysType | Field | Type | InternalType | Null | Key | Default | Extra | Visible | DefineExpr | WhereClause | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| test_table | DUP_KEYS | user_id | bigint | bigint | No | true | NULL | | true | | | +| | | name | varchar(20) | varchar(20) | Yes | false | NULL | NONE | true | | | +| | | age | int | int | Yes | false | NULL | NONE | true | | | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +``` \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md index 6b1d8c3ae9eb6..5e07b62ad787c 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md @@ -29,33 +29,69 @@ under the License. 该语句用于展示指定 table 的 schema 信息 -语法: +## 语法 ```sql DESC[RIBE] [db_name.]table_name [ALL]; ``` -说明: +## 返回值 -1. 如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema +| 列名 | 说明 | +| -- |--------------| +| IndexName | 表名 | +| IndexKeysType | 表模型 | +| Field | 列名 | +| Type | 数据类型 | +| Null | 是否允许为 NULL 值 | +| Key | 是否为key列 | +| Default | 默认值 | +| Extra | 显示一些额外的信息 | +| Visible | 是否可见 | +| DefineExpr | 定义表达式 | +| WhereClause | 过滤条件 相关的定义 | -## 示例 +## 权限控制 -1. 显示 Base 表 Schema +执行此 SQL 命令的用户必须至少具有以下权限: - ```sql - DESC table_name; - ``` +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +|:--------------| :------------- |:---------------------------------------------| +| SELECT_PRIV | 表(Table) | 当执行 DESC 时,需要拥有被查询的表的 SELECT_PRIV 权限 | + +## 注意事项 +如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema -2. 显示表所有 index 的 schema - ```sql - DESC db1.table_name ALL; - ``` +## 举例 -## 关键词 +1. 显示Base表Schema -DESCRIBE, DESC +```sql +DESC test_table; +``` +```text ++---------+-------------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------+-------------+------+-------+---------+-------+ +| user_id | bigint | No | true | NULL | | +| name | varchar(20) | Yes | false | NULL | NONE | +| age | int | Yes | false | NULL | NONE | ++---------+-------------+------+-------+---------+-------+ +``` +2. 显示表所有 index 的 schema +```sql +DESC demo.test_table ALL; +``` +```text ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| IndexName | IndexKeysType | Field | Type | InternalType | Null | Key | Default | Extra | Visible | DefineExpr | WhereClause | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| test_table | DUP_KEYS | user_id | bigint | bigint | No | true | NULL | | true | | | +| | | name | varchar(20) | varchar(20) | Yes | false | NULL | NONE | true | | | +| | | age | int | int | Yes | false | NULL | NONE | true | | | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +``` \ No newline at end of file diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md index c093551a6e644..b8a09f489c2d9 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md @@ -28,35 +28,73 @@ under the License. ## Description -This statement is used to display the schema information of the specified table +This statement is used to display the schema information of the specified table. -grammar: +## Syntax ```sql DESC[RIBE] [db_name.]table_name [ALL]; ``` -illustrate: +## Return Value + +| column name | description | +| -- |-----------------------------------| +| IndexName | Table name | +| IndexKeysType | Table Model | +| Field | Column Name | +| Type | Data Types | +| Null | Whether NULL values are allowed | +| Key | Is it a key column | +| Default | Default Value | +| Extra | Display some additional information | +| Visible | Visible | +| DefineExpr | Defining Expressions | +| WhereClause | Filter Conditions Related Definitions | + +## Access Control Requirements + +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +|:-------------|:----------|:----------------------------------------------------------------------------------------------| +| SELECT_PRIV | Table | When executing DESC, you need to have the SELECT_PRIV privilege on the table being queried | + +## Usage Notes +If ALL is specified, the schema of all indexes (rollup) of the table is displayed. -1. If ALL is specified, the schemas of all indexes (rollup) of the table will be displayed ## Examples 1. Display the Base table schema - ```sql - DESC table_name; - ``` - -2. Display the schema of all indexes of the table +```sql +DESC test_table; +``` +```text ++---------+-------------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------+-------------+------+-------+---------+-------+ +| user_id | bigint | No | true | NULL | | +| name | varchar(20) | Yes | false | NULL | NONE | +| age | int | Yes | false | NULL | NONE | ++---------+-------------+------+-------+---------+-------+ +``` - ```sql - DESC db1.table_name ALL; - ``` +2. Display the schema of all indexes in the table -## Keywords +```sql +DESC demo.test_table ALL; +``` - DESCRIBE +```text ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| IndexName | IndexKeysType | Field | Type | InternalType | Null | Key | Default | Extra | Visible | DefineExpr | WhereClause | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| test_table | DUP_KEYS | user_id | bigint | bigint | No | true | NULL | | true | | | +| | | name | varchar(20) | varchar(20) | Yes | false | NULL | NONE | true | | | +| | | age | int | int | Yes | false | NULL | NONE | true | | | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +``` -## Best Practice diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md index eb3f258dfa552..b8a09f489c2d9 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md @@ -28,35 +28,73 @@ under the License. ## Description -This statement is used to display the schema information of the specified table +This statement is used to display the schema information of the specified table. -grammar: +## Syntax ```sql DESC[RIBE] [db_name.]table_name [ALL]; ``` -illustrate: +## Return Value -1. If ALL is specified, the schemas of all indexes (rollup) of the table will be displayed +| column name | description | +| -- |-----------------------------------| +| IndexName | Table name | +| IndexKeysType | Table Model | +| Field | Column Name | +| Type | Data Types | +| Null | Whether NULL values are allowed | +| Key | Is it a key column | +| Default | Default Value | +| Extra | Display some additional information | +| Visible | Visible | +| DefineExpr | Defining Expressions | +| WhereClause | Filter Conditions Related Definitions | -## Example +## Access Control Requirements -1. Display the Base table schema +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +|:-------------|:----------|:----------------------------------------------------------------------------------------------| +| SELECT_PRIV | Table | When executing DESC, you need to have the SELECT_PRIV privilege on the table being queried | + +## Usage Notes +If ALL is specified, the schema of all indexes (rollup) of the table is displayed. - ```sql - DESC table_name; - ``` -2. Display the schema of all indexes of the table +## Examples + +1. Display the Base table schema + +```sql +DESC test_table; +``` +```text ++---------+-------------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++---------+-------------+------+-------+---------+-------+ +| user_id | bigint | No | true | NULL | | +| name | varchar(20) | Yes | false | NULL | NONE | +| age | int | Yes | false | NULL | NONE | ++---------+-------------+------+-------+---------+-------+ +``` - ```sql - DESC db1.table_name ALL; - ``` +2. Display the schema of all indexes in the table -## Keywords +```sql +DESC demo.test_table ALL; +``` - DESCRIBE +```text ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| IndexName | IndexKeysType | Field | Type | InternalType | Null | Key | Default | Extra | Visible | DefineExpr | WhereClause | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +| test_table | DUP_KEYS | user_id | bigint | bigint | No | true | NULL | | true | | | +| | | name | varchar(20) | varchar(20) | Yes | false | NULL | NONE | true | | | +| | | age | int | int | Yes | false | NULL | NONE | true | | | ++------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ +``` -## Best Practice From f1236ce4c813c05c9095f039aa6a68ee9154ce8f Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 14:43:51 +0800 Subject: [PATCH 02/11] =?UTF-8?q?CANCEL=20ALTER=20TABLE=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Alter/CANCEL-ALTER-TABLE.md | 100 ++++++++-------- .../Alter/CANCEL-ALTER-TABLE.md | 96 ++++++++------- .../table/CANCEL-ALTER-TABLE.md | 105 ++++++++++------- .../table/CANCEL-ALTER-TABLE.md | 106 +++++++++-------- .../table/CANCEL-ALTER-TABLE.md | 93 ++++++++------- .../table/CANCEL-ALTER-TABLE.md | 110 ++++++++++-------- 6 files changed, 332 insertions(+), 278 deletions(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index ba825fbc4c29b..a33e3d8bc4413 100644 --- a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -24,87 +24,91 @@ specific language governing permissions and limitations under the License. --> -## CANCEL-ALTER-TABLE +## Description -### Name +This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You can use this command to terminate an ALTER TABLE operation while it is being executed. -CANCEL ALTER TABLE - -### Description - -This statement is used to undo an ALTER operation. - -1. Undo the ALTER TABLE COLUMN operation - -grammar: +## Syntax ```sql -CANCEL ALTER TABLE COLUMN -FROM db_name.table_name +CANCEL ALTER TABLE FROM . [ [ ... ]] ``` -2. Undo the ALTER TABLE ROLLUP operation +## Required Parameters +**1. ``** +>Specify the type of modification to cancel, must choose one of: +>- COLUMN: Cancel table column modification operations +>- ROLLUP: Cancel materialized view modification operations -grammar: +**2.``** +> Specifies the identifier (that is, the name) of the database. +> +> Identifier must begin with an alphabet character (if Unicode name support is enabled, any language character is allowed), and must not contain spaces or special characters, except for the entire identifier string enclosed in quotes (e.g., `My Database`). +> +> Identifier cannot use reserved keywords. +> +> For more information, see Identifier Requirements and Reserved Keywords. -```sql -CANCEL ALTER TABLE ROLLUP -FROM db_name.table_name -``` +**3.``** +> Specifies the identifier (that is, the name) of the table, within its database (Database). +> +> Identifier must begin with an alphabet character (if Unicode name support is enabled, any language character is allowed), and must not contain spaces or special characters, except for the entire identifier string enclosed in quotes (e.g., `My Object`). +> +> Identifier cannot use reserved keywords. +> +> For more information, see Identifier Requirements and Reserved Keywords. -3. Batch cancel rollup operations based on job id - -grammar: - -```sql -CANCEL ALTER TABLE ROLLUP -FROM db_name.table_name (jobid,...) -``` +## Optional Parameters +**1. ``** +> The specific job ID to cancel. +> +> If a job ID is specified, only the specified job is canceled; if not specified, all ongoing modifications of the specified type (COLUMN or ROLLUP) on the table are canceled. +> +> You can specify multiple job IDs, separated by commas. +> +> You can obtain job IDs by using the `SHOW ALTER TABLE COLUMN` or `SHOW ALTER TABLE ROLLUP` command. -Notice: -- This command is an asynchronous operation. You need to use `show alter table rollup` to check the task status to confirm whether the execution is successful or not. +## Permission Control +Users who execute this SQL command must have at least the following permissions: -4. Undo the ALTER CLUSTER operation -grammar: +| Privilege | Object | Notes | +| :---------------- | :------------- | :---------------------------- | +| ALTER_PRIV | Table | CANCEL ALTER TABLE belongs to table ALTER operation | -``` -(To be implemented...) -``` -### Example +## Notes +- This command is an asynchronous operation, and the actual execution result needs to be confirmed by using `SHOW ALTER TABLE COLUMN` or `SHOW ALTER TABLE ROLLUP` to check the status of the task. -1. Undo the ALTER COLUMN operation on my_table. +## Example - [CANCEL ALTER TABLE COLUMN] +1. Cancel ALTER TABLE COLUMN operation ```sql CANCEL ALTER TABLE COLUMN -FROM example_db.my_table; +FROM db_name.table_name ``` -1. Undo the ADD ROLLUP operation under my_table. +2. Cancel ALTER TABLE ROLLUP operation - [CANCEL ALTER TABLE ROLLUP] ```sql CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table; +FROM db_name.table_name ``` -1. Undo the ADD ROLLUP operation under my_table according to the job id. +3. Cancel ALTER TABLE ROLLUP operation in batches based on job ID - [CANCEL ALTER TABLE ROLLUP] ```sql CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table(12801,12802); +FROM db_name.table_name (jobid,...) ``` -### Keywords - - CANCEL, ALTER, TABLE, CANCEL ALTER -### Best Practice +4. Cancel ALTER CLUSTER operation +```sql +(To be implemented...) +``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index 158f5c3b71621..de47ca257a90b 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -24,87 +24,93 @@ specific language governing permissions and limitations under the License. --> -## CANCEL-ALTER-TABLE -### Name - -CANCEL ALTER TABLE ## 描述 -该语句用于撤销一个 ALTER 操作。 - -1. 撤销 ALTER TABLE COLUMN 操作 +该语句用于取消(撤销)一个正在执行的 ALTER TABLE 操作。当一个 ALTER TABLE 操作正在执行时,您可以使用此命令来终止该操作。 -语法: +## 语法 ```sql -CANCEL ALTER TABLE COLUMN -FROM db_name.table_name +CANCEL ALTER TABLE FROM . [ [ ... ]] ``` -2. 撤销 ALTER TABLE ROLLUP 操作 - -语法: - -```sql -CANCEL ALTER TABLE ROLLUP -FROM db_name.table_name -``` +## 必选参数 +**1. ``** +>指定要取消的修改类型,必须选择其中一个 +>- `COLUMN`:取消对表列的修改操作 +>- `ROLLUP`:取消对物化视图的修改操作 -3. 根据job id批量撤销rollup操作 +**2.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 -语法: +**3.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 -```sql -CANCEL ALTER TABLE ROLLUP -FROM db_name.table_name (jobid,...) -``` +## 可选参数 +**1. ``** +> 要取消的具体作业ID。 +> +> 如果指定了作业ID,则只取消指定的作业;如果不指定,则取消该表上所有正在执行的指定类型(COLUMN 或 ROLLUP)的修改操作。 +> +> 可以指定多个作业ID,用逗号分隔。 +> +> 作业ID可以通过 `SHOW ALTER TABLE COLUMN` 或 `SHOW ALTER TABLE ROLLUP` 命令查看。 -注意: -- 该命令为异步操作,具体是否执行成功需要使用`show alter table rollup`查看任务状态确认 +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: -4. 撤销 ALTER CLUSTER 操作 -语法: +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| ALTER_PRIV | 表(Table) | CANCEL ALTER TABLE 属于表 ALTER 操作 | -``` -(待实现...) -``` -## 举例 +## 注意事项 +- 该命令为异步操作,具体是否执行成功需要使用`SHOW ALTER TABLE COLUMN` 或 `SHOW ALTER TABLE ROLLUP`查看任务状态确认 -1. 撤销针对 my_table 的 ALTER COLUMN 操作。 +## 示例 - [CANCEL ALTER TABLE COLUMN] +1. 撤销 ALTER TABLE COLUMN 操作 ```sql CANCEL ALTER TABLE COLUMN -FROM example_db.my_table; +FROM db_name.table_name ``` -1. 撤销 my_table 下的 ADD ROLLUP 操作。 +2. 撤销 ALTER TABLE ROLLUP 操作 - [CANCEL ALTER TABLE ROLLUP] ```sql CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table; +FROM db_name.table_name ``` -1. 根据job id撤销 my_table 下的 ADD ROLLUP 操作。 +3. 根据job id批量撤销rollup操作 - [CANCEL ALTER TABLE ROLLUP] ```sql CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table (12801,12802); +FROM db_name.table_name (jobid,...) ``` -### Keywords - - CANCEL, ALTER, TABLE, CANCEL ALTER -### Best Practice +4. 撤销 ALTER CLUSTER 操作 +```sql +(待实现...) +``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 207c7396871fc..ae4c1ad411f0d 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -28,11 +28,64 @@ under the License. ## 描述 -该语句用于撤销一个 ALTER 操作。 +该语句用于取消(撤销)一个正在执行的 ALTER TABLE 操作。当一个 ALTER TABLE 操作正在执行时,您可以使用此命令来终止该操作。 -1. 撤销 ALTER TABLE COLUMN 操作 +## 语法 + +```sql +CANCEL ALTER TABLE FROM . [ [ ... ]] +``` -语法: +## 必选参数 +**1. ``** +>指定要取消的修改类型,必须选择其中一个 +>- `COLUMN`:取消对表列的修改操作 +>- `ROLLUP`:取消对物化视图的修改操作 + +**2.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**3.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 +**1. ``** +> 要取消的具体作业ID。 +> +> 如果指定了作业ID,则只取消指定的作业;如果不指定,则取消该表上所有正在执行的指定类型(COLUMN 或 ROLLUP)的修改操作。 +> +> 可以指定多个作业ID,用逗号分隔。 +> +> 作业ID可以通过 `SHOW ALTER TABLE COLUMN` 或 `SHOW ALTER TABLE ROLLUP` 命令查看。 + + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| ALTER_PRIV | 表(Table) | CANCEL ALTER TABLE 属于表 ALTER 操作 | + + +## 注意事项 +- 该命令为异步操作,具体是否执行成功需要使用`SHOW ALTER TABLE COLUMN` 或 `SHOW ALTER TABLE ROLLUP`查看任务状态确认 + +## 示例 + +1. 撤销 ALTER TABLE COLUMN 操作 ```sql CANCEL ALTER TABLE COLUMN @@ -41,16 +94,13 @@ FROM db_name.table_name 2. 撤销 ALTER TABLE ROLLUP 操作 -语法: ```sql CANCEL ALTER TABLE ROLLUP FROM db_name.table_name ``` -3. 根据 job id 批量撤销 rollup 操作 - -语法: +3. 根据job id批量撤销rollup操作 ```sql @@ -58,43 +108,10 @@ CANCEL ALTER TABLE ROLLUP FROM db_name.table_name (jobid,...) ``` -注意: - -- 该命令为异步操作,具体是否执行成功需要使用`show alter table rollup`查看任务状态确认 - - -## 示例 -1. 撤销针对 my_table 的 ALTER COLUMN 操作。 +4. 撤销 ALTER CLUSTER 操作 - [CANCEL ALTER TABLE COLUMN] - - ```sql - CANCEL ALTER TABLE COLUMN - FROM example_db.my_table; - ``` - -1. 撤销 my_table 下的 ADD ROLLUP 操作。 - - [CANCEL ALTER TABLE ROLLUP] - - ```sql - CANCEL ALTER TABLE ROLLUP - FROM example_db.my_table; - ``` - -1. 根据 job id 撤销 my_table 下的 ADD ROLLUP 操作。 - - [CANCEL ALTER TABLE ROLLUP] - - ```sql - CANCEL ALTER TABLE ROLLUP - FROM example_db.my_table (12801,12802); - ``` - -## 关键词 - - CANCEL, ALTER, TABLE, CANCEL ALTER - -## 最佳实践 +```sql +(待实现...) +``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 1630fe7877874..2a1164033625c 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -28,11 +28,64 @@ under the License. ## 描述 -该语句用于撤销一个 ALTER 操作。 +该语句用于取消(撤销)一个正在执行的 ALTER TABLE 操作。当一个 ALTER TABLE 操作正在执行时,您可以使用此命令来终止该操作。 -1. 撤销 ALTER TABLE COLUMN 操作 +## 语法 + +```sql +CANCEL ALTER TABLE FROM . [ [ ... ]] +``` + +## 必选参数 +**1. ``** +>指定要取消的修改类型,必须选择其中一个 +>- `COLUMN`:取消对表列的修改操作 +>- `ROLLUP`:取消对物化视图的修改操作 + +**2.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**3.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 +**1. ``** +> 要取消的具体作业ID。 +> +> 如果指定了作业ID,则只取消指定的作业;如果不指定,则取消该表上所有正在执行的指定类型(COLUMN 或 ROLLUP)的修改操作。 +> +> 可以指定多个作业ID,用逗号分隔。 +> +> 作业ID可以通过 `SHOW ALTER TABLE COLUMN` 或 `SHOW ALTER TABLE ROLLUP` 命令查看。 + + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| ALTER_PRIV | 表(Table) | CANCEL ALTER TABLE 属于表 ALTER 操作 | + + +## 注意事项 +- 该命令为异步操作,具体是否执行成功需要使用`SHOW ALTER TABLE COLUMN` 或 `SHOW ALTER TABLE ROLLUP`查看任务状态确认 -语法: +## 示例 + +1. 撤销 ALTER TABLE COLUMN 操作 ```sql CANCEL ALTER TABLE COLUMN @@ -41,66 +94,23 @@ FROM db_name.table_name 2. 撤销 ALTER TABLE ROLLUP 操作 -语法: ```sql CANCEL ALTER TABLE ROLLUP FROM db_name.table_name ``` -3. 根据 job id 批量撤销 rollup 操作 +3. 根据job id批量撤销rollup操作 -语法: ```sql CANCEL ALTER TABLE ROLLUP FROM db_name.table_name (jobid,...) ``` -注意: - -- 该命令为异步操作,具体是否执行成功需要使用`show alter table rollup`查看任务状态确认 4. 撤销 ALTER CLUSTER 操作 -语法: - -``` -(待实现...) -``` - -## 示例 - -1. 撤销针对 my_table 的 ALTER COLUMN 操作。 - - [CANCEL ALTER TABLE COLUMN] - ```sql -CANCEL ALTER TABLE COLUMN -FROM example_db.my_table; -``` - -1. 撤销 my_table 下的 ADD ROLLUP 操作。 - - [CANCEL ALTER TABLE ROLLUP] - -```sql -CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table; -``` - -1. 根据 job id 撤销 my_table 下的 ADD ROLLUP 操作。 - - [CANCEL ALTER TABLE ROLLUP] - -```sql -CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table (12801,12802); +(待实现...) ``` - -## 关键词 - -CANCEL, ALTER, TABLE, CANCEL ALTER - - - diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 26b6fb0892105..002a12d123c51 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -25,82 +25,91 @@ under the License. --> - ## Description -This statement is used to undo an ALTER operation. - -1. Undo the ALTER TABLE COLUMN operation +This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You can use this command to terminate an ALTER TABLE operation while it is being executed. -grammar: +## Syntax ```sql -CANCEL ALTER TABLE COLUMN -FROM db_name.table_name +CANCEL ALTER TABLE FROM . [ [ ... ]] ``` -2. Undo the ALTER TABLE ROLLUP operation - -grammar: - -```sql -CANCEL ALTER TABLE ROLLUP -FROM db_name.table_name -``` +## Required Parameters +**1. ``** +>Specify the type of modification to cancel, must choose one of: +>- COLUMN: Cancel table column modification operations +>- ROLLUP: Cancel materialized view modification operations -3. Batch cancel rollup operations based on job id +**2.``** +> Specifies the identifier (that is, the name) of the database. +> +> Identifier must begin with an alphabet character (if Unicode name support is enabled, any language character is allowed), and must not contain spaces or special characters, except for the entire identifier string enclosed in quotes (e.g., `My Database`). +> +> Identifier cannot use reserved keywords. +> +> For more information, see Identifier Requirements and Reserved Keywords. -grammar: +**3.``** +> Specifies the identifier (that is, the name) of the table, within its database (Database). +> +> Identifier must begin with an alphabet character (if Unicode name support is enabled, any language character is allowed), and must not contain spaces or special characters, except for the entire identifier string enclosed in quotes (e.g., `My Object`). +> +> Identifier cannot use reserved keywords. +> +> For more information, see Identifier Requirements and Reserved Keywords. -```sql -CANCEL ALTER TABLE ROLLUP -FROM db_name.table_name (jobid,...) -``` +## Optional Parameters +**1. ``** +> The specific job ID to cancel. +> +> If a job ID is specified, only the specified job is canceled; if not specified, all ongoing modifications of the specified type (COLUMN or ROLLUP) on the table are canceled. +> +> You can specify multiple job IDs, separated by commas. +> +> You can obtain job IDs by using the `SHOW ALTER TABLE COLUMN` or `SHOW ALTER TABLE ROLLUP` command. -Notice: -- This command is an asynchronous operation. You need to use `show alter table rollup` to check the task status to confirm whether the execution is successful or not. +## Permission Control +Users who execute this SQL command must have at least the following permissions: -4. Undo the ALTER CLUSTER operation -grammar: +| Privilege | Object | Notes | +| :---------------- | :------------- | :---------------------------- | +| ALTER_PRIV | Table | CANCEL ALTER TABLE belongs to table ALTER operation | -``` -(To be implemented...) -``` -## Examples +## Notes +- This command is an asynchronous operation, and the actual execution result needs to be confirmed by using `SHOW ALTER TABLE COLUMN` or `SHOW ALTER TABLE ROLLUP` to check the status of the task. -1. Undo the ALTER COLUMN operation on my_table. +## Example - [CANCEL ALTER TABLE COLUMN] +1. Cancel ALTER TABLE COLUMN operation ```sql CANCEL ALTER TABLE COLUMN -FROM example_db.my_table; +FROM db_name.table_name ``` -1. Undo the ADD ROLLUP operation under my_table. +2. Cancel ALTER TABLE ROLLUP operation - [CANCEL ALTER TABLE ROLLUP] ```sql CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table; +FROM db_name.table_name ``` -1. Undo the ADD ROLLUP operation under my_table according to the job id. +3. Cancel ALTER TABLE ROLLUP operation in batches based on job ID - [CANCEL ALTER TABLE ROLLUP] ```sql CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table(12801,12802); +FROM db_name.table_name (jobid,...) ``` -## Keywords - - CANCEL, ALTER, TABLE, CANCEL ALTER -## Best Practice +4. Cancel ALTER CLUSTER operation +```sql +(To be implemented...) +``` diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index a735bbfa049c1..461671378b0da 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -24,83 +24,91 @@ specific language governing permissions and limitations under the License. --> - - ## Description -This statement is used to undo an ALTER operation. - -1. Undo the ALTER TABLE COLUMN operation - -grammar: - -```sql -CANCEL ALTER TABLE COLUMN -FROM db_name.table_name -``` - -2. Undo the ALTER TABLE ROLLUP operation - -grammar: - -```sql -CANCEL ALTER TABLE ROLLUP -FROM db_name.table_name -``` - -3. Batch cancel rollup operations based on job id +This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You can use this command to terminate an ALTER TABLE operation while it is being executed. -grammar: +## Syntax ```sql -CANCEL ALTER TABLE ROLLUP -FROM db_name.table_name (jobid,...) +CANCEL ALTER TABLE FROM . [ [ ... ]] ``` -Notice: - -- This command is an asynchronous operation. You need to use `show alter table rollup` to check the task status to confirm whether the execution is successful or not. - -4. Undo the ALTER CLUSTER operation - -grammar: - -``` -(To be implemented...) -``` +## Required Parameters +**1. ``** +>Specify the type of modification to cancel, must choose one of: +>- COLUMN: Cancel table column modification operations +>- ROLLUP: Cancel materialized view modification operations + +**2.``** +> Specifies the identifier (that is, the name) of the database. +> +> Identifier must begin with an alphabet character (if Unicode name support is enabled, any language character is allowed), and must not contain spaces or special characters, except for the entire identifier string enclosed in quotes (e.g., `My Database`). +> +> Identifier cannot use reserved keywords. +> +> For more information, see Identifier Requirements and Reserved Keywords. + +**3.``** +> Specifies the identifier (that is, the name) of the table, within its database (Database). +> +> Identifier must begin with an alphabet character (if Unicode name support is enabled, any language character is allowed), and must not contain spaces or special characters, except for the entire identifier string enclosed in quotes (e.g., `My Object`). +> +> Identifier cannot use reserved keywords. +> +> For more information, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters +**1. ``** +> The specific job ID to cancel. +> +> If a job ID is specified, only the specified job is canceled; if not specified, all ongoing modifications of the specified type (COLUMN or ROLLUP) on the table are canceled. +> +> You can specify multiple job IDs, separated by commas. +> +> You can obtain job IDs by using the `SHOW ALTER TABLE COLUMN` or `SHOW ALTER TABLE ROLLUP` command. + + +## Permission Control +Users who execute this SQL command must have at least the following permissions: + + +| Privilege | Object | Notes | +| :---------------- | :------------- | :---------------------------- | +| ALTER_PRIV | Table | CANCEL ALTER TABLE belongs to table ALTER operation | + + +## Notes +- This command is an asynchronous operation, and the actual execution result needs to be confirmed by using `SHOW ALTER TABLE COLUMN` or `SHOW ALTER TABLE ROLLUP` to check the status of the task. ## Example -1. Undo the ALTER COLUMN operation on my_table. - - [CANCEL ALTER TABLE COLUMN] +1. Cancel ALTER TABLE COLUMN operation ```sql CANCEL ALTER TABLE COLUMN -FROM example_db.my_table; +FROM db_name.table_name ``` -1. Undo the ADD ROLLUP operation under my_table. +2. Cancel ALTER TABLE ROLLUP operation - [CANCEL ALTER TABLE ROLLUP] ```sql CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table; +FROM db_name.table_name ``` -1. Undo the ADD ROLLUP operation under my_table according to the job id. +3. Cancel ALTER TABLE ROLLUP operation in batches based on job ID - [CANCEL ALTER TABLE ROLLUP] ```sql CANCEL ALTER TABLE ROLLUP -FROM example_db.my_table(12801,12802); +FROM db_name.table_name (jobid,...) ``` -## Keywords - CANCEL, ALTER, TABLE, CANCEL ALTER - -## Best Practice +4. Cancel ALTER CLUSTER operation +```sql +(To be implemented...) +``` From 9d68b936c67f13d5c5bc86b2c1ff37fdfe32f0eb Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 14:56:18 +0800 Subject: [PATCH 03/11] =?UTF-8?q?CANCEL=20ALTER=20TABLE=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md | 2 +- .../Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md | 2 +- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 2 +- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 2 +- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 2 +- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index a33e3d8bc4413..46098bfdec56b 100644 --- a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -31,7 +31,7 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE FROM . [ [ ... ]] +CANCEL ALTER TABLE FROM . [ [ , ... ]] ``` ## Required Parameters diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index de47ca257a90b..473d2e7af101e 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -33,7 +33,7 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE FROM . [ [ ... ]] +CANCEL ALTER TABLE FROM . [ [ , ... ]] ``` ## 必选参数 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index ae4c1ad411f0d..0eb349fc3c487 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -33,7 +33,7 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE FROM . [ [ ... ]] +CANCEL ALTER TABLE FROM . [ [ , ... ]] ``` ## 必选参数 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 2a1164033625c..f94c1e6c935da 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -33,7 +33,7 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE FROM . [ [ ... ]] +CANCEL ALTER TABLE FROM . [ [ , ... ]] ``` ## 必选参数 diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 002a12d123c51..7962c0881bab7 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -32,7 +32,7 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE FROM . [ [ ... ]] +CANCEL ALTER TABLE FROM . [ [ , ... ]] ``` ## Required Parameters diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 461671378b0da..5265f10f4b866 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -31,7 +31,7 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE FROM . [ [ ... ]] +CANCEL ALTER TABLE FROM . [ [ , ... ]] ``` ## Required Parameters From f329ef93e61c2a3837ed5067ffe0fad45b84d0c7 Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 15:09:08 +0800 Subject: [PATCH 04/11] =?UTF-8?q?TRUNCATE=20TABLE=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Drop/TRUNCATE-TABLE.md | 90 ++++++++++++------- .../Drop/TRUNCATE-TABLE.md | 59 ++++++++---- .../table-and-view/table/TRUNCATE-TABLE.md | 52 ++++++++--- .../table-and-view/table/TRUNCATE-TABLE.md | 52 ++++++++--- .../table-and-view/table/TRUNCATE-TABLE.md | 82 ++++++++++++----- .../table-and-view/table/TRUNCATE-TABLE.md | 85 ++++++++++++------ 6 files changed, 303 insertions(+), 117 deletions(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md index d7779d3901c49..122167368107e 100644 --- a/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md @@ -24,46 +24,74 @@ specific language governing permissions and limitations under the License. --> -## TRUNCATE-TABLE +## Description -### Name +This statement is used to clear the data of the specified table and partition. -TRUNCATE TABLE - -### Description - -This statement is used to clear the data of the specified table and partition -grammar: +## Syntax ```sql -TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; +TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; ``` - -illustrate: - -- The statement clears the data, but leaves the table or partition. -- Unlike DELETE, this statement can only clear the specified table or partition as a whole, and cannot add filter conditions. -- Unlike DELETE, using this method to clear data will not affect query performance. +## Required Parameters + +**1.``** +> Specifies the identifier (name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters +**1.``** +> Specifies the identifier (name) of the partition. +> +> Identifiers must begin with an alphabetic character (or any character in a script if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + + +## Access Control Requirements + +The user executing this SQL command must have at least the following permissions: + + +| Privilege | Object | Notes | +|:----------------|:----------|:---------------------------| +| Drop_priv | Table | TRUNCATE TABLE belongs to the table DROP operation | + +## Usage Notes + +- This statement clears data but retains the table or partition. +- Unlike DELETE, this statement can only clear the specified table or partition as a whole and cannot add filtering conditions. +- Unlike DELETE, clearing data in this way will not affect query performance. - The data deleted by this operation cannot be recovered. -- When using this command, the table status needs to be NORMAL, that is, operations such as SCHEMA CHANGE are not allowed. -- This command may cause the ongoing load to fail +- When using this command, the table status must be NORMAL, that is, operations such as SCHEMA CHANGE are not allowed. +- This command may cause the import in progress to fail. -### Example +## Examples 1. Clear the table tbl under example_db - ```sql - TRUNCATE TABLE example_db.tbl; - ``` - -2. Empty p1 and p2 partitions of table tbl - - ```sql - TRUNCATE TABLE tbl PARTITION(p1, p2); - ``` - -### Keywords + ```sql + TRUNCATE TABLE example_db.tbl; + ``` - TRUNCATE, TABLE +2. Clear the p1 and p2 partitions of table tbl -### Best Practice + ```sql + TRUNCATE TABLE tbl PARTITION(p1, p2); + ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md index 25e44f27cd2d6..f6a98bf2d38a7 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md @@ -24,22 +24,56 @@ specific language governing permissions and limitations under the License. --> -## TRUNCATE-TABLE - -### Name - -TRUNCATE TABLE ## 描述 该语句用于清空指定表和分区的数据 -语法: +## 语法 ```sql -TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; +TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; ``` +## 必选参数 + +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 +**1.``** +> 指定分区的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + + +## 权限控制 -说明: +执行此 SQL 命令的用户必须至少具有以下权限: + + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Drop_priv | 表(Table) | TRUNCATE TABLE 属于表 DROP 操作 | + +## 注意事项 - 该语句清空数据,但保留表或分区。 - 不同于 DELETE,该语句只能整体清空指定的表或分区,不能添加过滤条件。 @@ -48,7 +82,7 @@ TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; - 使用该命令时,表状态需为 NORMAL,即不允许正在进行 SCHEMA CHANGE 等操作。 - 该命令可能会导致正在进行的导入失败。 -## 举例 +## 示例 1. 清空 example_db 下的表 tbl @@ -61,10 +95,3 @@ TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; ```sql TRUNCATE TABLE tbl PARTITION(p1, p2); ``` - -### Keywords - - TRUNCATE, TABLE - -### Best Practice - diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md index 9fe9de74b168d..0d002534155ec 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md @@ -29,13 +29,52 @@ under the License. ## 描述 该语句用于清空指定表和分区的数据 -语法: +## 语法 ```sql -TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; +TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; ``` +## 必选参数 -说明: +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 +**1.``** +> 指定分区的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + + +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: + + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Drop_priv | 表(Table) | TRUNCATE TABLE 属于表 DROP 操作 | + +## 注意事项 - 该语句清空数据,但保留表或分区。 - 不同于 DELETE,该语句只能整体清空指定的表或分区,不能添加过滤条件。 @@ -57,10 +96,3 @@ TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; ```sql TRUNCATE TABLE tbl PARTITION(p1, p2); ``` - -## 关键词 - - TRUNCATE, TABLE - -## 最佳实践 - diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md index 49afdef2f2972..dd5922dca3262 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md @@ -28,13 +28,52 @@ under the License. ## 描述 该语句用于清空指定表和分区的数据 -语法: +## 语法 ```sql -TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; +TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; ``` +## 必选参数 -说明: +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 +**1.``** +> 指定分区的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + + +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: + + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Drop_priv | 表(Table) | TRUNCATE TABLE 属于表 DROP 操作 | + +## 注意事项 - 该语句清空数据,但保留表或分区。 - 不同于 DELETE,该语句只能整体清空指定的表或分区,不能添加过滤条件。 @@ -56,10 +95,3 @@ TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; ```sql TRUNCATE TABLE tbl PARTITION(p1, p2); ``` - -## 关键词 - -TRUNCATE, TABLE - - - diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md index 34ce957d8b911..5e0da6290503c 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md @@ -27,38 +27,72 @@ under the License. ## Description -This statement is used to clear the data of the specified table and partition -grammar: +This statement is used to clear the data of the specified table and partition. + +## Syntax ```sql -TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; +TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; ``` - -illustrate: - -- The statement clears the data, but leaves the table or partition. -- Unlike DELETE, this statement can only clear the specified table or partition as a whole, and cannot add filter conditions. -- Unlike DELETE, using this method to clear data will not affect query performance. +## Required Parameters + +**1.``** +> Specifies the identifier (name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters +**1.``** +> Specifies the identifier (name) of the partition. +> +> Identifiers must begin with an alphabetic character (or any character in a script if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + + +## Access Control Requirements + +The user executing this SQL command must have at least the following permissions: + + +| Privilege | Object | Notes | +|:----------------|:----------|:---------------------------| +| Drop_priv | Table | TRUNCATE TABLE belongs to the table DROP operation | + +## Usage Notes + +- This statement clears data but retains the table or partition. +- Unlike DELETE, this statement can only clear the specified table or partition as a whole and cannot add filtering conditions. +- Unlike DELETE, clearing data in this way will not affect query performance. - The data deleted by this operation cannot be recovered. -- When using this command, the table status needs to be NORMAL, that is, operations such as SCHEMA CHANGE are not allowed. -- This command may cause the ongoing load to fail +- When using this command, the table status must be NORMAL, that is, operations such as SCHEMA CHANGE are not allowed. +- This command may cause the import in progress to fail. ## Examples 1. Clear the table tbl under example_db - ```sql - TRUNCATE TABLE example_db.tbl; - ``` - -2. Empty p1 and p2 partitions of table tbl - - ```sql - TRUNCATE TABLE tbl PARTITION(p1, p2); - ``` - -## Keywords - - TRUNCATE, TABLE + ```sql + TRUNCATE TABLE example_db.tbl; + ``` +2. Clear the p1 and p2 partitions of table tbl + ```sql + TRUNCATE TABLE tbl PARTITION(p1, p2); + ``` diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md index 97bfd9fcc039f..6004c91a883e1 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md @@ -24,41 +24,74 @@ specific language governing permissions and limitations under the License. --> - ## Description -This statement is used to clear the data of the specified table and partition -grammar: +This statement is used to clear the data of the specified table and partition. + +## Syntax ```sql -TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)]; +TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; ``` - -illustrate: - -- The statement clears the data, but leaves the table or partition. -- Unlike DELETE, this statement can only clear the specified table or partition as a whole, and cannot add filter conditions. -- Unlike DELETE, using this method to clear data will not affect query performance. +## Required Parameters + +**1.``** +> Specifies the identifier (name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters +**1.``** +> Specifies the identifier (name) of the partition. +> +> Identifiers must begin with an alphabetic character (or any character in a script if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + + +## Access Control Requirements + +The user executing this SQL command must have at least the following permissions: + + +| Privilege | Object | Notes | +|:----------------|:----------|:---------------------------| +| Drop_priv | Table | TRUNCATE TABLE belongs to the table DROP operation | + +## Usage Notes + +- This statement clears data but retains the table or partition. +- Unlike DELETE, this statement can only clear the specified table or partition as a whole and cannot add filtering conditions. +- Unlike DELETE, clearing data in this way will not affect query performance. - The data deleted by this operation cannot be recovered. -- When using this command, the table status needs to be NORMAL, that is, operations such as SCHEMA CHANGE are not allowed. -- This command may cause the ongoing load to fail +- When using this command, the table status must be NORMAL, that is, operations such as SCHEMA CHANGE are not allowed. +- This command may cause the import in progress to fail. -## Example +## Examples 1. Clear the table tbl under example_db - ```sql - TRUNCATE TABLE example_db.tbl; - ``` - -2. Empty p1 and p2 partitions of table tbl - - ```sql - TRUNCATE TABLE tbl PARTITION(p1, p2); - ``` - -## Keywords + ```sql + TRUNCATE TABLE example_db.tbl; + ``` - TRUNCATE, TABLE +2. Clear the p1 and p2 partitions of table tbl -## Best Practice + ```sql + TRUNCATE TABLE tbl PARTITION(p1, p2); + ``` From 68da1472ebe0ba2e2027021f674f31dfb231f60e Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 15:21:46 +0800 Subject: [PATCH 05/11] =?UTF-8?q?Drop=20TABLE=E8=AF=AD=E5=8F=A5=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Drop/DROP-TABLE.md | 80 ++++++++++++------- .../Drop/DROP-TABLE.md | 54 +++++++++---- .../table-and-view/table/DROP-TABLE.md | 65 ++++++++++----- .../table-and-view/table/DROP-TABLE.md | 57 +++++++++---- .../table-and-view/table/DROP-TABLE.md | 74 ++++++++++++----- .../table-and-view/table/DROP-TABLE.md | 69 +++++++++++----- 6 files changed, 284 insertions(+), 115 deletions(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-TABLE.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-TABLE.md index a03767104c537..cede7fd4aca33 100644 --- a/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-TABLE.md +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-TABLE.md @@ -24,43 +24,69 @@ specific language governing permissions and limitations under the License. --> -## DROP-TABLE +## Description -### Name +This statement is used to delete a Table. +## Syntax -DROP TABLE +```sql +DROP TABLE [IF EXISTS] [.] [FORCE]; +``` -### Description +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. -This statement is used to drop a table. -grammar: +## Optional Parameters -```sql -DROP TABLE [IF EXISTS] [db_name.]table_name [FORCE]; -``` +**1.``** +> Specifies the identifier (name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.`FORCE`** +> If specified, the system will not check whether there are any unfinished transactions in the table. The table will be deleted directly and cannot be recovered. This operation is generally not recommended. + +## Access Control Requirements + +The user executing this SQL command must have at least the following permissions: + + +| Privilege | Object | Notes | +|:----------------|:----------|:---------------------------| +| Drop_priv | Table | DROP TABLE belongs to the table DROP operation | + +## Usage Notes +- After executing `DROP TABLE` for a period of time, the deleted table can be restored by using the RECOVER statement. For details, see the [RECOVER](../../../../sql-manual/sql-statements/Database-Administration-Statements/RECOVER) statement. +- If you execute `DROP TABLE FORCE`, the system will not check whether there are unfinished transactions for the table. The table will be deleted directly and cannot be restored. Generally, this operation is not recommended. -illustrate: +## Examples -- After executing `DROP TABLE` for a period of time, the dropped table can be recovered through the RECOVER statement. See [RECOVER](../../../../sql-manual/sql-statements/Database-Administration-Statements/RECOVER) statement for details -- If you execute `DROP TABLE FORCE`, the system will not check whether there are unfinished transactions in the table, the table will be deleted directly and cannot be recovered, this operation is generally not recommended +1. Deleting a Table -### Example + ```sql + DROP TABLE my_table; + ``` -1. Delete a table - - ```sql - DROP TABLE my_table; - ``` - -2. If it exists, delete the table of the specified database - - ```sql - DROP TABLE IF EXISTS example_db.my_table; - ``` +2. If it exists, delete the Table of the specified Database. -### Keywords + ```sql + DROP TABLE IF EXISTS example_db.my_table; + ``` - DROP, TABLE +3. If it exists, delete the Table of the specified Database, forcibly delete it -### Best Practice + ```sql + DROP TABLE IF EXISTS example_db.my_table FORCE; + ``` \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-TABLE.md index ed1fe8507bcff..f3b3ec6324063 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-TABLE.md @@ -24,28 +24,56 @@ specific language governing permissions and limitations under the License. --> -## DROP-TABLE -### Name - -DROP TABLE ## 描述 该语句用于删除 Table。 -语法: +## 语法 ```sql -DROP TABLE [IF EXISTS] [db_name.]table_name [FORCE]; +DROP TABLE [IF EXISTS] [.] [FORCE]; ``` +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 + +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.`FORCE`** +> 如果指定,则系统不会检查该表是否存在未完成的事务,表将直接被删除并且不能被恢复,一般不建议执行此操作。 + +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: -说明: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Drop_priv | 表(Table) | DROP TABLE 属于表 DROP 操作 | + +## 注意事项 - 执行 `DROP TABLE` 一段时间内,可以通过 RECOVER 语句恢复被删除的表。详见 [RECOVER](../../../../sql-manual/sql-statements/Database-Administration-Statements/RECOVER) 语句。 - 如果执行 `DROP TABLE FORCE`,则系统不会检查该表是否存在未完成的事务,表将直接被删除并且不能被恢复,一般不建议执行此操作。 -## 举例 +## 示例 1. 删除一个 Table @@ -59,10 +87,8 @@ DROP TABLE [IF EXISTS] [db_name.]table_name [FORCE]; DROP TABLE IF EXISTS example_db.my_table; ``` +3. 如果存在,删除指定 Database 的 Table,强制删除 -### Keywords - - DROP, TABLE - -### Best Practice - + ```sql + DROP TABLE IF EXISTS example_db.my_table FORCE; + ``` \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md index bcd686cfd448c..d2a9cfd3ab948 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md @@ -25,40 +25,69 @@ under the License. --> - ## 描述 -该语句用于删除 table。 -语法: +该语句用于删除 Table。 +## 语法 ```sql -DROP TABLE [IF EXISTS] [db_name.]table_name [FORCE]; +DROP TABLE [IF EXISTS] [.] [FORCE]; ``` +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 + +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.`FORCE`** +> 如果指定,则系统不会检查该表是否存在未完成的事务,表将直接被删除并且不能被恢复,一般不建议执行此操作。 + +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: + -说明: +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Drop_priv | 表(Table) | DROP TABLE 属于表 DROP 操作 | -- 执行 DROP TABLE 一段时间内,可以通过 RECOVER 语句恢复被删除的表。详见 [RECOVER](../../../../sql-manual/sql-statements/recycle/RECOVER) 语句 -- 如果执行 DROP TABLE FORCE,则系统不会检查该表是否存在未完成的事务,表将直接被删除并且不能被恢复,一般不建议执行此操作 +## 注意事项 + +- 执行 `DROP TABLE` 一段时间内,可以通过 RECOVER 语句恢复被删除的表。详见 [RECOVER](../../../../sql-manual/sql-statements/Database-Administration-Statements/RECOVER) 语句。 +- 如果执行 `DROP TABLE FORCE`,则系统不会检查该表是否存在未完成的事务,表将直接被删除并且不能被恢复,一般不建议执行此操作。 ## 示例 -1. 删除一个 table - +1. 删除一个 Table + ```sql DROP TABLE my_table; ``` - -2. 如果存在,删除指定 database 的 table - + +2. 如果存在,删除指定 Database 的 Table + ```sql DROP TABLE IF EXISTS example_db.my_table; ``` - -## 关键词 - - DROP, TABLE - -## 最佳实践 +3. 如果存在,删除指定 Database 的 Table,强制删除 + ```sql + DROP TABLE IF EXISTS example_db.my_table FORCE; + ``` \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md index 6d84cdbd4a5cb..d2a9cfd3ab948 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md @@ -28,37 +28,66 @@ under the License. ## 描述 该语句用于删除 Table。 - -语法: +## 语法 ```sql -DROP TABLE [IF EXISTS] [db_name.]table_name [FORCE]; +DROP TABLE [IF EXISTS] [.] [FORCE]; ``` +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 + +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.`FORCE`** +> 如果指定,则系统不会检查该表是否存在未完成的事务,表将直接被删除并且不能被恢复,一般不建议执行此操作。 + +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: + + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Drop_priv | 表(Table) | DROP TABLE 属于表 DROP 操作 | -说明: +## 注意事项 -- 执行 `DROP TABLE` 一段时间内,可以通过 RECOVER 语句恢复被删除的表。详见 [RECOVER](../../../../sql-manual/sql-statements/recycle/RECOVER) 语句。 +- 执行 `DROP TABLE` 一段时间内,可以通过 RECOVER 语句恢复被删除的表。详见 [RECOVER](../../../../sql-manual/sql-statements/Database-Administration-Statements/RECOVER) 语句。 - 如果执行 `DROP TABLE FORCE`,则系统不会检查该表是否存在未完成的事务,表将直接被删除并且不能被恢复,一般不建议执行此操作。 ## 示例 1. 删除一个 Table - + ```sql DROP TABLE my_table; ``` - + 2. 如果存在,删除指定 Database 的 Table - + ```sql DROP TABLE IF EXISTS example_db.my_table; ``` - - -## 关键词 - -DROP, TABLE - +3. 如果存在,删除指定 Database 的 Table,强制删除 + ```sql + DROP TABLE IF EXISTS example_db.my_table FORCE; + ``` \ No newline at end of file diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md index ec7aa12d5bd46..1938f2dca7d3d 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md @@ -25,39 +25,69 @@ under the License. --> - - ## Description -This statement is used to drop a table. -grammar: +This statement is used to delete a Table. +## Syntax ```sql -DROP TABLE [IF EXISTS] [db_name.]table_name [FORCE]; +DROP TABLE [IF EXISTS] [.] [FORCE]; ``` +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters + +**1.``** +> Specifies the identifier (name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.`FORCE`** +> If specified, the system will not check whether there are any unfinished transactions in the table. The table will be deleted directly and cannot be recovered. This operation is generally not recommended. + +## Access Control Requirements -illustrate: +The user executing this SQL command must have at least the following permissions: -- After executing DROP TABLE for a period of time, the dropped table can be recovered through the RECOVER statement. See [RECOVER](../../../../sql-manual/sql-statements/recycle/RECOVER) statement for details -- If you execute DROP TABLE FORCE, the system will not check whether there are unfinished transactions in the table, the table will be deleted directly and cannot be recovered, this operation is generally not recommended + +| Privilege | Object | Notes | +|:----------------|:----------|:---------------------------| +| Drop_priv | Table | DROP TABLE belongs to the table DROP operation | + +## Usage Notes + +- After executing `DROP TABLE` for a period of time, the deleted table can be restored by using the RECOVER statement. For details, see the [RECOVER](../../../../sql-manual/sql-statements/Database-Administration-Statements/RECOVER) statement. +- If you execute `DROP TABLE FORCE`, the system will not check whether there are unfinished transactions for the table. The table will be deleted directly and cannot be restored. Generally, this operation is not recommended. ## Examples -1. Delete a table - - ```sql - DROP TABLE my_table; - ``` - -2. If it exists, delete the table of the specified database - - ```sql - DROP TABLE IF EXISTS example_db.my_table; - ``` +1. Deleting a Table + + ```sql + DROP TABLE my_table; + ``` + +2. If it exists, delete the Table of the specified Database. -## Keywords + ```sql + DROP TABLE IF EXISTS example_db.my_table; + ``` - DROP, TABLE +3. If it exists, delete the Table of the specified Database, forcibly delete it -## Best Practice + ```sql + DROP TABLE IF EXISTS example_db.my_table FORCE; + ``` \ No newline at end of file diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md index 8fedbba16d8ad..7a6510b11d8f6 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DROP-TABLE.md @@ -25,40 +25,69 @@ specific language governing permissions and limitations under the License. --> - - ## Description -This statement is used to drop a table. -grammar: +This statement is used to delete a Table. +## Syntax ```sql -DROP TABLE [IF EXISTS] [db_name.]table_name [FORCE]; +DROP TABLE [IF EXISTS] [.] [FORCE]; ``` +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters + +**1.``** +> Specifies the identifier (name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.`FORCE`** +> If specified, the system will not check whether there are any unfinished transactions in the table. The table will be deleted directly and cannot be recovered. This operation is generally not recommended. + +## Access Control Requirements + +The user executing this SQL command must have at least the following permissions: -illustrate: -- After executing DROP TABLE for a period of time, the dropped table can be recovered through the RECOVER statement. See [RECOVER](../../../../sql-manual/sql-statements/recycle/RECOVER) statement for details +| Privilege | Object | Notes | +|:----------------|:----------|:---------------------------| +| Drop_priv | Table | DROP TABLE belongs to the table DROP operation | -- If you execute DROP TABLE FORCE, the system will not check whether there are unfinished transactions in the table, the table will be deleted directly and cannot be recovered, this operation is generally not recommended +## Usage Notes -## Example +- After executing `DROP TABLE` for a period of time, the deleted table can be restored by using the RECOVER statement. For details, see the [RECOVER](../../../../sql-manual/sql-statements/Database-Administration-Statements/RECOVER) statement. +- If you execute `DROP TABLE FORCE`, the system will not check whether there are unfinished transactions for the table. The table will be deleted directly and cannot be restored. Generally, this operation is not recommended. -1. Delete a table +## Examples - ```sql - DROP TABLE my_table; - ``` +1. Deleting a Table -2. If it exists, delete the table of the specified database + ```sql + DROP TABLE my_table; + ``` - ```sql - DROP TABLE IF EXISTS example_db.my_table; - ``` +2. If it exists, delete the Table of the specified Database. -## Keywords + ```sql + DROP TABLE IF EXISTS example_db.my_table; + ``` - DROP, TABLE +3. If it exists, delete the Table of the specified Database, forcibly delete it -## Best Practice \ No newline at end of file + ```sql + DROP TABLE IF EXISTS example_db.my_table FORCE; + ``` \ No newline at end of file From 15114780e6498bfd87082dfbd709c435cffbe78f Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 15:39:11 +0800 Subject: [PATCH 06/11] =?UTF-8?q?SHOW=20CREATE=20TABLE=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Show-Statements/SHOW-CREATE-TABLE.md | 65 +++++++++++++------ .../Show-Statements/SHOW-CREATE-TABLE.md | 62 +++++++++++++----- .../table-and-view/table/SHOW-CREATE-TABLE.md | 53 +++++++++++---- .../table-and-view/table/SHOW-CREATE-TABLE.md | 59 ++++++++++++----- .../table-and-view/table/SHOW-CREATE-TABLE.md | 59 ++++++++++++----- .../table-and-view/table/SHOW-CREATE-TABLE.md | 56 +++++++++++----- 6 files changed, 252 insertions(+), 102 deletions(-) diff --git a/docs/sql-manual/sql-statements/Show-Statements/SHOW-CREATE-TABLE.md b/docs/sql-manual/sql-statements/Show-Statements/SHOW-CREATE-TABLE.md index 0d80bac831abd..4ec2ba55f5d46 100644 --- a/docs/sql-manual/sql-statements/Show-Statements/SHOW-CREATE-TABLE.md +++ b/docs/sql-manual/sql-statements/Show-Statements/SHOW-CREATE-TABLE.md @@ -24,40 +24,63 @@ specific language governing permissions and limitations under the License. --> -## SHOW-CREATE-TABLE - -### Name - -SHOW CREATE TABLE - -### Description +## Description This statement is used to display the creation statement of the data table. -grammar: +## Syntax ```sql -SHOW [BRIEF] CREATE TABLE [DBNAME.]TABLE_NAME +SHOW [BRIEF] CREATE TABLE [.] ``` -illustrate: +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters +**1.`BRIEF`** +> Display only basic information about the table, excluding column definitions. + +**2.``** +> Specifies the identifier (i.e., name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. -1. `BRIEF` : will not show partitions info +## Return Value +| column name | description | +| -- |-------------| +| Table | Table name | +| Create Table | Create table statement | -2. `DBNAMNE` : database name -3. `TABLE_NAME` : table name +## Access Control Requirements -### Example +The user executing this SQL command must have at least the following permissions: -1. View the table creation statement of a table +| Privilege | Object | Notes | +|:------------------|:----------|:--------------------------------| +| Select_priv | Table | SHOW CREATE TABLE belongs to table SELECT operation | - ```sql - SHOW CREATE TABLE demo.tb1 - ``` -### Keywords +## Examples - SHOW, CREATE, TABLE +1. View the creation statement of a table -### Best Practice + ```sql + SHOW CREATE TABLE demo.test_table; + ``` +2. View the simplified table creation statement for a table + ```sql + SHOW BRIEF CREATE TABLE demo.test_table; + ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Show-Statements/SHOW-CREATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Show-Statements/SHOW-CREATE-TABLE.md index 07fbf5217ec14..403cc41883c5a 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Show-Statements/SHOW-CREATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Show-Statements/SHOW-CREATE-TABLE.md @@ -24,39 +24,65 @@ specific language governing permissions and limitations under the License. --> -## SHOW-CREATE-TABLE -### Name - -SHOW CREATE TABLE ## 描述 该语句用于展示数据表的创建语句。 -语法: +## 语法 ```sql -SHOW [BRIEF] CREATE TABLE [DBNAME.]TABLE_NAME +SHOW [BRIEF] CREATE TABLE [.] ``` -说明: +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 -1. `BRIEF` : 返回结果中不展示分区信息 -2. `DBNAMNE` : 数据库名称 -3. `TABLE_NAME` : 表名 +## 可选参数 +**1.`BRIEF`** +> 仅显示表的基本信息,不包括列的定义。 -## 举例 +**2.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 -1. 查看某个表的建表语句 +## 返回值 +| 列名 | 说明 | +| -- |------| +| Table | 表名 | +| Create Table | 建表语句 | - ```sql - SHOW CREATE TABLE demo.tb1 - ``` +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Select_priv | 表(Table) | SHOW CREATE TABLE 属于表 SELECT 操作 | -### Keywords - SHOW, CREATE, TABLE +## 示例 -### Best Practice +1. 查看某个表的建表语句 + + ```sql + SHOW CREATE TABLE demo.test_table; + ``` +2. 查看某个表的简化建表语句 + ```sql + SHOW BRIEF CREATE TABLE demo.test_table; + ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md index 604440e3e89ca..1b2b78ac9c6c0 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md @@ -29,32 +29,59 @@ under the License. 该语句用于展示数据表的创建语句。 -语法: +## 语法 ```sql -SHOW [BRIEF] CREATE TABLE [DBNAME.]TABLE_NAME +SHOW [BRIEF] CREATE TABLE [.] ``` -说明: +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 +## 可选参数 +**1.`BRIEF`** +> 仅显示表的基本信息,不包括列的定义。 +**2.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 -1. `BRIEF` : 返回结果中不展示分区信息 +## 返回值 +| 列名 | 说明 | +| -- |------| +| Table | 表名 | +| Create Table | 建表语句 | + +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Select_priv | 表(Table) | SHOW CREATE TABLE 属于表 SELECT 操作 | -2. `DBNAMNE` : 数据库名称 -3. `TABLE_NAME` : 表名 ## 示例 1. 查看某个表的建表语句 ```sql - SHOW CREATE TABLE demo.tb1 + SHOW CREATE TABLE demo.test_table; ``` +2. 查看某个表的简化建表语句 -## 关键词 - - SHOW, CREATE, TABLE - -## 最佳实践 - + ```sql + SHOW BRIEF CREATE TABLE demo.test_table; + ``` diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md index 6649f6c6c9961..06836ac57c6d2 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md @@ -24,36 +24,63 @@ specific language governing permissions and limitations under the License. --> - - - - ## 描述 该语句用于展示数据表的创建语句。 -语法: +## 语法 ```sql -SHOW [BRIEF] CREATE TABLE [DBNAME.]TABLE_NAME +SHOW [BRIEF] CREATE TABLE [.] ``` -说明: +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 +**1.`BRIEF`** +> 仅显示表的基本信息,不包括列的定义。 + +**2.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 返回值 +| 列名 | 说明 | +| -- |------| +| Table | 表名 | +| Create Table | 建表语句 | + +## 权限控制 + +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :---------------- | :------------- | :---------------------------- | +| Select_priv | 表(Table) | SHOW CREATE TABLE 属于表 SELECT 操作 | -1. `BRIEF` : 返回结果中不展示分区信息 -2. `DBNAMNE` : 数据库名称 -3. `TABLE_NAME` : 表名 ## 示例 1. 查看某个表的建表语句 ```sql - SHOW CREATE TABLE demo.tb1 + SHOW CREATE TABLE demo.test_table; ``` +2. 查看某个表的简化建表语句 -## 关键词 - -SHOW, CREATE, TABLE - - + ```sql + SHOW BRIEF CREATE TABLE demo.test_table; + ``` diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md index 99e84e0556698..adb7c9470ebf9 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md @@ -25,40 +25,63 @@ under the License. --> - - ## Description This statement is used to display the creation statement of the data table. -grammar: +## Syntax ```sql -SHOW [BRIEF] CREATE TABLE [DBNAME.]TABLE_NAME +SHOW [BRIEF] CREATE TABLE [.] ``` -illustrate: - +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. +## Optional Parameters +**1.`BRIEF`** +> Display only basic information about the table, excluding column definitions. -1. `BRIEF` : will not show partitions info +**2.``** +> Specifies the identifier (i.e., name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. +## Return Value +| column name | description | +| -- |-------------| +| Table | Table name | +| Create Table | Create table statement | +## Access Control Requirements -2. `DBNAMNE` : database name -3. `TABLE_NAME` : table name +The user executing this SQL command must have at least the following permissions: -## Examples - -1. View the table creation statement of a table +| Privilege | Object | Notes | +|:------------------|:----------|:--------------------------------| +| Select_priv | Table | SHOW CREATE TABLE belongs to table SELECT operation | - ```sql - SHOW CREATE TABLE demo.tb1 - ``` -## Keywords +## Examples - SHOW, CREATE, TABLE +1. View the creation statement of a table -## Best Practice + ```sql + SHOW CREATE TABLE demo.test_table; + ``` +2. View the simplified table creation statement for a table + ```sql + SHOW BRIEF CREATE TABLE demo.test_table; + ``` diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md index 55154d2b5489a..2a58b904dce77 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/SHOW-CREATE-TABLE.md @@ -26,39 +26,63 @@ under the License. --> - ## Description This statement is used to display the creation statement of the data table. -grammar: +## Syntax ```sql -SHOW [BRIEF] CREATE TABLE [DBNAME.]TABLE_NAME +SHOW [BRIEF] CREATE TABLE [.] ``` -illustrate: +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters +**1.`BRIEF`** +> Display only basic information about the table, excluding column definitions. +**2.``** +> Specifies the identifier (i.e., name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. +## Return Value +| column name | description | +| -- |-------------| +| Table | Table name | +| Create Table | Create table statement | -1. `BRIEF` : will not show partitions info +## Access Control Requirements +The user executing this SQL command must have at least the following permissions: +| Privilege | Object | Notes | +|:------------------|:----------|:--------------------------------| +| Select_priv | Table | SHOW CREATE TABLE belongs to table SELECT operation | -2. `DBNAMNE` : database name -3. `TABLE_NAME` : table name -## Example +## Examples -1. View the table creation statement of a table +1. View the creation statement of a table ```sql - SHOW CREATE TABLE demo.tb1 + SHOW CREATE TABLE demo.test_table; ``` +2. View the simplified table creation statement for a table -## Keywords - - SHOW, CREATE, TABLE - -## Best Practice - + ```sql + SHOW BRIEF CREATE TABLE demo.test_table; + ``` From 924dc93a3e1691f0705774645c1f094a1f7488bf Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 15:54:32 +0800 Subject: [PATCH 07/11] =?UTF-8?q?DESC=20TABLE=E8=AF=AD=E5=8F=A5=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Utility-Statements/DESCRIBE.md | 29 +++++++++++++++- .../Utility-Statements/DESCRIBE.md | 30 ++++++++++++++-- .../table-and-view/table/DESC-TABLE.md | 34 +++++++++++++++++-- .../table-and-view/table/DESC-TABLE.md | 32 +++++++++++++++-- .../table-and-view/table/DESC-TABLE.md | 29 +++++++++++++++- .../table-and-view/table/DESC-TABLE.md | 30 ++++++++++++++-- 6 files changed, 172 insertions(+), 12 deletions(-) diff --git a/docs/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md b/docs/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md index 60e341f59788b..a1a643ec7732c 100644 --- a/docs/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md +++ b/docs/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md @@ -34,6 +34,33 @@ This statement is used to display the schema information of the specified table. DESC[RIBE] [db_name.]table_name [ALL]; ``` +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters + +**1.``** +> Specifies the identifier (i.e., name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.`RIBE`** +> Returns description information of all columns in a table + +**3.`ALL`** +> Returns description information for all columns + ## Return Value | column name | description | @@ -59,7 +86,7 @@ Users executing this SQL command must have at least the following privileges: | SELECT_PRIV | Table | When executing DESC, you need to have the SELECT_PRIV privilege on the table being queried | ## Usage Notes -If ALL is specified, the schema of all indexes (rollup) of the table is displayed. +- If ALL is specified, the schema of all indexes (rollup) of the table is displayed. ## Examples diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md index fdc8469719ba2..53c3935f84fdc 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Utility-Statements/DESCRIBE.md @@ -32,8 +32,34 @@ under the License. ## 语法 ```sql -DESC[RIBE] [db_name.]table_name [ALL]; +DESC[RIBE] [.] [ALL]; ``` +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 + +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.`RIBE`** +> 返回表的所有列的描述信息 + +**3.`ALL`** +> 返回所有列的描述信息 ## 返回值 @@ -60,7 +86,7 @@ DESC[RIBE] [db_name.]table_name [ALL]; | SELECT_PRIV | 表(Table) | 当执行 DESC 时,需要拥有被查询的表的 SELECT_PRIV 权限 | ## 注意事项 -如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema +- 如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema ## 举例 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md index 67baed78ce53a..04c6090caf068 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md @@ -32,8 +32,34 @@ under the License. ## 语法 ```sql -DESC[RIBE] [db_name.]table_name [ALL]; +DESC[RIBE] [.] [ALL]; ``` +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 + +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.`RIBE`** +> 返回表的所有列的描述信息 + +**3.`ALL`** +> 返回所有列的描述信息 ## 返回值 @@ -60,7 +86,7 @@ DESC[RIBE] [db_name.]table_name [ALL]; | SELECT_PRIV | 表(Table) | 当执行 DESC 时,需要拥有被查询的表的 SELECT_PRIV 权限 | ## 注意事项 -如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema +- 如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema ## 举例 @@ -94,4 +120,6 @@ DESC demo.test_table ALL; | | | name | varchar(20) | varchar(20) | Yes | false | NULL | NONE | true | | | | | | age | int | int | Yes | false | NULL | NONE | true | | | +------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ -``` \ No newline at end of file +``` + + diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md index 5e07b62ad787c..c548f6ea8b246 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md @@ -32,8 +32,34 @@ under the License. ## 语法 ```sql -DESC[RIBE] [db_name.]table_name [ALL]; +DESC[RIBE] [.] [ALL]; ``` +## 必选参数 +**1.``** +> 指定表的标识符(即名称),在其所在的数据库(Database)中必须唯一。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Object`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +## 可选参数 + +**1.``** +> 指定数据库的标识符(即名称)。 +> +> 标识符必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个标识符字符串用反引号括起来(例如`My Database`)。 +> +> 标识符不能使用保留关键字。 +> +> 有关更多详细信息,请参阅标识符要求和保留关键字。 + +**2.`RIBE`** +> 返回表的所有列的描述信息 + +**3.`ALL`** +> 返回所有列的描述信息 ## 返回值 @@ -60,7 +86,7 @@ DESC[RIBE] [db_name.]table_name [ALL]; | SELECT_PRIV | 表(Table) | 当执行 DESC 时,需要拥有被查询的表的 SELECT_PRIV 权限 | ## 注意事项 -如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema +- 如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema ## 举例 @@ -94,4 +120,4 @@ DESC demo.test_table ALL; | | | name | varchar(20) | varchar(20) | Yes | false | NULL | NONE | true | | | | | | age | int | int | Yes | false | NULL | NONE | true | | | +------------+---------------+---------+-------------+--------------+------+-------+---------+-------+---------+------------+-------------+ -``` \ No newline at end of file +``` diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md index b8a09f489c2d9..7a073373451e7 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md @@ -36,6 +36,33 @@ This statement is used to display the schema information of the specified table. DESC[RIBE] [db_name.]table_name [ALL]; ``` +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters + +**1.``** +> Specifies the identifier (i.e., name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.`RIBE`** +> Returns description information of all columns in a table + +**3.`ALL`** +> Returns description information for all columns + ## Return Value | column name | description | @@ -61,7 +88,7 @@ Users executing this SQL command must have at least the following privileges: | SELECT_PRIV | Table | When executing DESC, you need to have the SELECT_PRIV privilege on the table being queried | ## Usage Notes -If ALL is specified, the schema of all indexes (rollup) of the table is displayed. +- If ALL is specified, the schema of all indexes (rollup) of the table is displayed. ## Examples diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md index b8a09f489c2d9..7646e4bfa7598 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/DESC-TABLE.md @@ -25,7 +25,6 @@ under the License. --> - ## Description This statement is used to display the schema information of the specified table. @@ -36,6 +35,33 @@ This statement is used to display the schema information of the specified table. DESC[RIBE] [db_name.]table_name [ALL]; ``` +## Required Parameters +**1.``** +> Specifies the table identifier (name), which must be unique within the database in which it is located. +> +> Identifiers must begin with an alphabetic character (or any character in a language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g. `My Object`). +> +> Identifiers cannot use reserved keywords. +> +> For more details, see Identifier Requirements and Reserved Keywords. + +## Optional Parameters + +**1.``** +> Specifies the identifier (i.e., name) for the database. +> +> Identifiers must begin with an alphabetic character (or any character in a given language if unicode name support is enabled) and cannot contain spaces or special characters unless the entire identifier string is enclosed in backticks (e.g., `My Database`). +> +> Identifiers cannot use reserved keywords. +> +> See Identifier Requirements and Reserved Keywords for more details. + +**2.`RIBE`** +> Returns description information of all columns in a table + +**3.`ALL`** +> Returns description information for all columns + ## Return Value | column name | description | @@ -61,7 +87,7 @@ Users executing this SQL command must have at least the following privileges: | SELECT_PRIV | Table | When executing DESC, you need to have the SELECT_PRIV privilege on the table being queried | ## Usage Notes -If ALL is specified, the schema of all indexes (rollup) of the table is displayed. +- If ALL is specified, the schema of all indexes (rollup) of the table is displayed. ## Examples From 969155e45e4dd24efdc1742a7b067b6e4f50393c Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 15:59:00 +0800 Subject: [PATCH 08/11] =?UTF-8?q?CANCEL=20ALTER=20TABLE=20=E8=AF=AD?= =?UTF-8?q?=E5=8F=A5=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md | 4 ++-- .../Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md | 4 ++-- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 4 ++-- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 4 ++-- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 4 ++-- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index 46098bfdec56b..8d4bb11407f6d 100644 --- a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -31,11 +31,11 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE FROM . [ [ , ... ]] +CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] ``` ## Required Parameters -**1. ``** +**1. `COLUMN|ROLLUP`** >Specify the type of modification to cancel, must choose one of: >- COLUMN: Cancel table column modification operations >- ROLLUP: Cancel materialized view modification operations diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index 473d2e7af101e..cb42200aa477a 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -33,11 +33,11 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE FROM . [ [ , ... ]] +CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] ``` ## 必选参数 -**1. ``** +**1. `COLUMN|ROLLUP`** >指定要取消的修改类型,必须选择其中一个 >- `COLUMN`:取消对表列的修改操作 >- `ROLLUP`:取消对物化视图的修改操作 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 0eb349fc3c487..19e4dc6774504 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -33,11 +33,11 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE FROM . [ [ , ... ]] +CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] ``` ## 必选参数 -**1. ``** +**1. `COLUMN|ROLLUP`** >指定要取消的修改类型,必须选择其中一个 >- `COLUMN`:取消对表列的修改操作 >- `ROLLUP`:取消对物化视图的修改操作 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index f94c1e6c935da..9bfead9e12f2c 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -33,11 +33,11 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE FROM . [ [ , ... ]] +CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] ``` ## 必选参数 -**1. ``** +**1. `COLUMN|ROLLUP`** >指定要取消的修改类型,必须选择其中一个 >- `COLUMN`:取消对表列的修改操作 >- `ROLLUP`:取消对物化视图的修改操作 diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 7962c0881bab7..5e8cc741b8b52 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -32,11 +32,11 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE FROM . [ [ , ... ]] +CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] ``` ## Required Parameters -**1. ``** +**1. `COLUMN|ROLLUP`** >Specify the type of modification to cancel, must choose one of: >- COLUMN: Cancel table column modification operations >- ROLLUP: Cancel materialized view modification operations diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 5265f10f4b866..482cf848a79d6 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -31,11 +31,11 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE FROM . [ [ , ... ]] +CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] ``` ## Required Parameters -**1. ``** +**1. `COLUMN|ROLLUP`** >Specify the type of modification to cancel, must choose one of: >- COLUMN: Cancel table column modification operations >- ROLLUP: Cancel materialized view modification operations From f7e83d00f3364822a7d035bd2e1a5c6fd453ac4e Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 16:02:13 +0800 Subject: [PATCH 09/11] =?UTF-8?q?TRUNCATE=20TABLE=20=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data-Definition-Statements/Drop/TRUNCATE-TABLE.md | 2 +- .../Data-Definition-Statements/Drop/TRUNCATE-TABLE.md | 2 +- .../sql-statements/table-and-view/table/TRUNCATE-TABLE.md | 2 +- .../sql-statements/table-and-view/table/TRUNCATE-TABLE.md | 2 +- .../sql-statements/table-and-view/table/TRUNCATE-TABLE.md | 2 +- .../sql-statements/table-and-view/table/TRUNCATE-TABLE.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md index 122167368107e..dcda5b4bece0d 100644 --- a/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md @@ -31,7 +31,7 @@ This statement is used to clear the data of the specified table and partition. ## Syntax ```sql -TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; +TRUNCATE TABLE [.][ PARTITION ( [, ... ] ) ]; ``` ## Required Parameters diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md index f6a98bf2d38a7..608919e714485 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE.md @@ -31,7 +31,7 @@ under the License. ## 语法 ```sql -TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; +TRUNCATE TABLE [.][ PARTITION ( [, ... ] ) ]; ``` ## 必选参数 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md index 0d002534155ec..06e0b6b50a3ed 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md @@ -32,7 +32,7 @@ under the License. ## 语法 ```sql -TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; +TRUNCATE TABLE [.][ PARTITION ( [, ... ] ) ]; ``` ## 必选参数 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md index dd5922dca3262..8b1c6ebfa62ee 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md @@ -31,7 +31,7 @@ under the License. ## 语法 ```sql -TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; +TRUNCATE TABLE [.][ PARTITION ( [, ... ] ) ]; ``` ## 必选参数 diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md index 5e0da6290503c..f78028a6e2d42 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md @@ -32,7 +32,7 @@ This statement is used to clear the data of the specified table and partition. ## Syntax ```sql -TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; +TRUNCATE TABLE [.][ PARTITION ( [, ... ] ) ]; ``` ## Required Parameters diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md index 6004c91a883e1..5e77cb2b10987 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/TRUNCATE-TABLE.md @@ -31,7 +31,7 @@ This statement is used to clear the data of the specified table and partition. ## Syntax ```sql -TRUNCATE TABLE [.][ PARTITION ( [, partition_name2 ... ] ) ]; +TRUNCATE TABLE [.][ PARTITION ( [, ... ] ) ]; ``` ## Required Parameters From 9e837c547f687d610db74ccfe6dc1d8f0099b6ac Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 17:11:31 +0800 Subject: [PATCH 10/11] =?UTF-8?q?CANCEL=20ALTER=20TABLE=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md | 2 +- .../Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md | 2 +- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 2 +- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 2 +- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 2 +- .../sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index 8d4bb11407f6d..b7c174c7b5426 100644 --- a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -31,7 +31,7 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] ``` ## Required Parameters diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index cb42200aa477a..bd5ef4b793c39 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -33,7 +33,7 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] ``` ## 必选参数 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 19e4dc6774504..fa5621d76a5da 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -33,7 +33,7 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] ``` ## 必选参数 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 9bfead9e12f2c..bb7332b797263 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -33,7 +33,7 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] ``` ## 必选参数 diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 5e8cc741b8b52..178d454d60a05 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -32,7 +32,7 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] ``` ## Required Parameters diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 482cf848a79d6..8e5afec9f2ecb 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -31,7 +31,7 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE COLUMN|ROLLUP FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] ``` ## Required Parameters From d6c35ae1e84e9a17a9c5abc9d1dd6b827b0d7d73 Mon Sep 17 00:00:00 2001 From: qiushiyan <840035156@qq.com> Date: Fri, 17 Jan 2025 17:18:31 +0800 Subject: [PATCH 11/11] =?UTF-8?q?CANCEL=20ALTER=20TABLE=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Alter/CANCEL-ALTER-TABLE.md | 11 ++++++----- .../Alter/CANCEL-ALTER-TABLE.md | 7 ++++--- .../table-and-view/table/CANCEL-ALTER-TABLE.md | 7 ++++--- .../table-and-view/table/CANCEL-ALTER-TABLE.md | 7 ++++--- .../table-and-view/table/CANCEL-ALTER-TABLE.md | 11 ++++++----- .../table-and-view/table/CANCEL-ALTER-TABLE.md | 11 ++++++----- 6 files changed, 30 insertions(+), 24 deletions(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index b7c174c7b5426..97886d6f1055f 100644 --- a/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -31,14 +31,15 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | MATERIALIZED VIEW | ROLLUP } FROM . [ [ , ... ]] ``` ## Required Parameters -**1. `COLUMN|ROLLUP`** ->Specify the type of modification to cancel, must choose one of: ->- COLUMN: Cancel table column modification operations ->- ROLLUP: Cancel materialized view modification operations +**1. `{ COLUMN | MATERIALIZED VIEW | ROLLUP }`** +>Specify the type of modification to be canceled, one of which must be selected +>- `COLUMN`: Cancel the modification operation on the table column +>- `ROLLUP`: Cancel the modification operation on the view +>- `MATERIALIZED VIEW`: Cancel the modification operation on the materialized view **2.``** > Specifies the identifier (that is, the name) of the database. diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md index bd5ef4b793c39..def3ce2028303 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Alter/CANCEL-ALTER-TABLE.md @@ -33,14 +33,15 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | MATERIALIZED VIEW | ROLLUP } FROM . [ [ , ... ]] ``` ## 必选参数 -**1. `COLUMN|ROLLUP`** +**1. `{ COLUMN | MATERIALIZED VIEW | ROLLUP }`** >指定要取消的修改类型,必须选择其中一个 >- `COLUMN`:取消对表列的修改操作 ->- `ROLLUP`:取消对物化视图的修改操作 +>- `ROLLUP`:取消对视图的修改操作 +>- `MATERIALIZED VIEW`: 取消对物化视图的修改操作 **2.``** > 指定数据库的标识符(即名称)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index fa5621d76a5da..9f23c3cd8359d 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -33,14 +33,15 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | MATERIALIZED VIEW | ROLLUP } FROM . [ [ , ... ]] ``` ## 必选参数 -**1. `COLUMN|ROLLUP`** +**1. `{ COLUMN | MATERIALIZED VIEW | ROLLUP }`** >指定要取消的修改类型,必须选择其中一个 >- `COLUMN`:取消对表列的修改操作 ->- `ROLLUP`:取消对物化视图的修改操作 +>- `ROLLUP`:取消对视图的修改操作 +>- `MATERIALIZED VIEW`: 取消对物化视图的修改操作 **2.``** > 指定数据库的标识符(即名称)。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index bb7332b797263..0144f8e495cad 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -33,14 +33,15 @@ under the License. ## 语法 ```sql -CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | MATERIALIZED VIEW | ROLLUP } FROM . [ [ , ... ]] ``` ## 必选参数 -**1. `COLUMN|ROLLUP`** +**1. `{ COLUMN | MATERIALIZED VIEW | ROLLUP }`** >指定要取消的修改类型,必须选择其中一个 >- `COLUMN`:取消对表列的修改操作 ->- `ROLLUP`:取消对物化视图的修改操作 +>- `ROLLUP`:取消对视图的修改操作 +>- `MATERIALIZED VIEW`: 取消对物化视图的修改操作 **2.``** > 指定数据库的标识符(即名称)。 diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 178d454d60a05..cfd3bdd718272 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -32,14 +32,15 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | MATERIALIZED VIEW | ROLLUP } FROM . [ [ , ... ]] ``` ## Required Parameters -**1. `COLUMN|ROLLUP`** ->Specify the type of modification to cancel, must choose one of: ->- COLUMN: Cancel table column modification operations ->- ROLLUP: Cancel materialized view modification operations +**1. `{ COLUMN | MATERIALIZED VIEW | ROLLUP }`** +>Specify the type of modification to be canceled, one of which must be selected +>- `COLUMN`: Cancel the modification operation on the table column +>- `ROLLUP`: Cancel the modification operation on the view +>- `MATERIALIZED VIEW`: Cancel the modification operation on the materialized view **2.``** > Specifies the identifier (that is, the name) of the database. diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md index 8e5afec9f2ecb..5701e4592fe7d 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/table/CANCEL-ALTER-TABLE.md @@ -31,14 +31,15 @@ This statement is used to cancel (revoke) an ongoing ALTER TABLE operation. You ## Syntax ```sql -CANCEL ALTER TABLE { COLUMN | ROLLUP } FROM . [ [ , ... ]] +CANCEL ALTER TABLE { COLUMN | MATERIALIZED VIEW | ROLLUP } FROM . [ [ , ... ]] ``` ## Required Parameters -**1. `COLUMN|ROLLUP`** ->Specify the type of modification to cancel, must choose one of: ->- COLUMN: Cancel table column modification operations ->- ROLLUP: Cancel materialized view modification operations +**1. `{ COLUMN | MATERIALIZED VIEW | ROLLUP }`** +>Specify the type of modification to be canceled, one of which must be selected +>- `COLUMN`: Cancel the modification operation on the table column +>- `ROLLUP`: Cancel the modification operation on the view +>- `MATERIALIZED VIEW`: Cancel the modification operation on the materialized view **2.``** > Specifies the identifier (that is, the name) of the database.