This is an automated email from the ASF dual-hosted git repository. kassiez pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push: new 47b15a12e1f [doc](Atomicity Replace) address comments and translate en doc by LLM (#1781) 47b15a12e1f is described below commit 47b15a12e1f08ece8e814ad1d605067f2f7f4e35 Author: zhannngchen <zhangc...@selectdb.com> AuthorDate: Wed Jan 15 15:01:22 2025 +0800 [doc](Atomicity Replace) address comments and translate en doc by LLM (#1781) ## Versions - [ ] dev - [ ] 3.0 - [ ] 2.1 - [ ] 2.0 ## Languages - [ ] Chinese - [ ] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built --- docs/data-operate/delete/atomicity-replace.md | 32 +++++++++----------- .../data-operate/delete/atomicity-replace.md | 35 ++++++++-------------- .../data-operate/delete/atomicity-replace.md | 35 ++++++++-------------- .../data-operate/delete/atomicity-replace.md | 35 ++++++++-------------- .../data-operate/delete/atomicity-replace.md | 32 +++++++++----------- .../data-operate/delete/atomicity-replace.md | 32 +++++++++----------- 6 files changed, 81 insertions(+), 120 deletions(-) diff --git a/docs/data-operate/delete/atomicity-replace.md b/docs/data-operate/delete/atomicity-replace.md index 2c3a7358771..9876e95167b 100644 --- a/docs/data-operate/delete/atomicity-replace.md +++ b/docs/data-operate/delete/atomicity-replace.md @@ -24,14 +24,11 @@ specific language governing permissions and limitations under the License. --> -# Atomicity Replace +Doris supports atomic replacement operations between two tables, applicable only to OLAP tables. -Doris supports atomic table replacement operations for two tables. This is only applicable to OLAP tables. +## Applicable Scenarios -## Applicable scenarios - -- Atomic overwrite operations -- In certain cases, users may want to rewrite data in a table. However, the "delete and load" approach causes a data invisibility window. To solve that, Doris allows users to create a new table of the same schema using the CREATE TABLE LIKE statement, import the new data into this new table, and then atomically replace the old table with the new table. For atomic replacement at the partition level, please refer to the [temporary partition](../../data-operate/delete/table-temp-partition/) [...] +Sometimes, users need to rewrite table data, but deleting and then importing the data would result in a period of unavailability. In such cases, users can create a new table with the same structure using the `CREATE TABLE LIKE` statement, import the new data into the new table, and then perform an atomic replacement of the old table. For partition-level atomic overwrite operations, refer to the [temporary partition documentation](../delete/table-temp-partition). ## Syntax @@ -40,29 +37,28 @@ ALTER TABLE [db.]tbl1 REPLACE WITH TABLE tbl2 [PROPERTIES('swap' = 'true')]; ``` -Replace table tbl1 with table tbl2. +Replace table `tbl1` with table `tbl2`. -If `swap` is `true`, after the replacement, data in `tbl1` will be replaced by that in `tbl2`, while data in `tbl2` will be replaced by that in `tbl1`. In other words, the two tables will swap data. +If the `swap` parameter is `true`, after the replacement, the data in `tbl1` will be the original data in `tbl2`, and the data in `tbl2` will be the original data in `tbl1`, meaning the data in the two tables will be swapped. -If `swap` is `false`, after the replacement, data in `tbl1` will be replaced by that in `tbl2` and `tbl2` will be deleted. +If the `swap` parameter is `false`, after the replacement, the data in `tbl1` will be the original data in `tbl2`, and `tbl2` will be deleted. -## Implementation +## Principle -In fact, table replacement is to combine the following operations into one atomic operation. +The table replacement function turns the following set of operations into an atomic operation. -Assuming that table A is to be replaced with table B, and `swap` is set to `true`. The operations to be implemented are as follows: +Assuming table A is replaced with table B, and `swap` is `true`, the operations are as follows: 1. Rename table B to table A. 2. Rename table A to table B. -If `swap` is set to `false`, the operations are as follows: +If `swap` is `false`, the operations are as follows: 1. Delete table A. 2. Rename table B to table A. -## Note +## Notes -- `swap` defaults to `true`, meaning to swap the data between two tables. -- If `swap` is set to `false`, the table being replaced (table A) will be deleted and cannot be recovered. -- The replacement operation can only be implemented between two OLAP tables and it does not check for table schema consistency. -- The replacement operation does not change the existing privilege settings because privilege checks are based on table names. +- If the `swap` parameter is `false`, the replaced table (table A) will be deleted and cannot be recovered. +- The replacement operation can only occur between two OLAP tables and does not check if the table structures are consistent. +- The replacement operation will not change the original permission settings, as permission checks are based on table names. \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/data-operate/delete/atomicity-replace.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/data-operate/delete/atomicity-replace.md index 807181b8869..55ee145c211 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/data-operate/delete/atomicity-replace.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/data-operate/delete/atomicity-replace.md @@ -24,14 +24,11 @@ specific language governing permissions and limitations under the License. --> - -Doris 支持对两个表进行原子的替换操作。该操作仅适用于 OLAP 表。 +Doris 支持对两个表进行原子替换操作,仅适用于 OLAP 表。 ## 适用场景 -- 原子的覆盖写操作 - -- 某些情况下,用户希望能够重写某张表的数据,但如果采用先删除再导入的方式进行,在中间会有一段时间无法查看数据。这时,用户可以先使用 `CREATE TABLE LIKE` 语句创建一个相同结构的新表,将新的数据导入到新表后,通过替换操作,原子的替换旧表,以达到目的。分区级别的原子覆盖写操作,请参阅 [临时分区文档](../delete/table-temp-partition)。 +在某些情况下,用户希望重写表数据,但如果先删除再导入,会有一段时间无法查看数据。此时,用户可以先使用 `CREATE TABLE LIKE` 语句创建一个相同结构的新表,将新数据导入新表后,通过替换操作原子替换旧表。分区级别的原子覆盖写操作,请参阅 [临时分区文档](../delete/table-temp-partition)。 ## 语法说明 @@ -42,32 +39,26 @@ ALTER TABLE [db.]tbl1 REPLACE WITH TABLE tbl2 将表 tbl1 替换为表 tbl2。 -如果 `swap` 参数为 `true`,则替换后,名称为 `tbl1` 表中的数据为原 `tbl2` 表中的数据。而名称为 `tbl2` 表中的数据为原 `tbl1` 表中的数据。即两张表数据发生了互换。 +如果 `swap` 参数为 `true`,替换后,tbl1 表中的数据为原 tbl2 表中的数据,tbl2 表中的数据为原 tbl1 表中的数据,即两张表数据互换。 -如果 `swap` 参数为 `false`,则替换后,名称为 `tbl1` 表中的数据为原 `tbl2` 表中的数据。而名称为 `tbl2` 表被删除。 +如果 `swap` 参数为 `false`,替换后,tbl1 表中的数据为原 tbl2 表中的数据,tbl2 表被删除。 ## 原理 -替换表功能,实际上是将以下操作集合变成一个原子操作。 +替换表功能将以下操作集合变成一个原子操作。 -假设要将表 A 替换为表 B,且 `swap` 为 `true`,则操作如下: +假设将表 A 替换为表 B,且 `swap` 为 `true`,操作如下: -1. 将表 B 重名为表 A。 +1. 将表 B 重命名为表 A。 +2. 将表 A 重命名为表 B。 -2. 将表 A 重名为表 B。 - -如果 `swap` 为 `false`,则操作如下: +如果 `swap` 为 `false`,操作如下: 1. 删除表 A。 - -2. 将表 B 重名为表 A。 +2. 将表 B 重命名为表 A。 ## 注意事项 -- `swap` 参数默认为 `true`。即替换表操作相当于将两张表数据进行交换。 - -- 如果设置 `swap` 参数为 `false`,则被替换的表(表 A)将被删除,且无法恢复。 - -- 替换操作仅能发生在两张 OLAP 表之间,且不会检查两张表的表结构是否一致。 - -- 替换操作不会改变原有的权限设置。因为权限检查以表名称为准。 \ No newline at end of file +- 如果 `swap` 参数为 `false`,被替换的表(表 A)将被删除,且无法恢复。 +- 替换操作仅能发生在两张 OLAP 表之间,不检查两张表的表结构是否一致。 +- 替换操作不会改变原有的权限设置,因为权限检查以表名称为准。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/data-operate/delete/atomicity-replace.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/data-operate/delete/atomicity-replace.md index 807181b8869..55ee145c211 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/data-operate/delete/atomicity-replace.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/data-operate/delete/atomicity-replace.md @@ -24,14 +24,11 @@ specific language governing permissions and limitations under the License. --> - -Doris 支持对两个表进行原子的替换操作。该操作仅适用于 OLAP 表。 +Doris 支持对两个表进行原子替换操作,仅适用于 OLAP 表。 ## 适用场景 -- 原子的覆盖写操作 - -- 某些情况下,用户希望能够重写某张表的数据,但如果采用先删除再导入的方式进行,在中间会有一段时间无法查看数据。这时,用户可以先使用 `CREATE TABLE LIKE` 语句创建一个相同结构的新表,将新的数据导入到新表后,通过替换操作,原子的替换旧表,以达到目的。分区级别的原子覆盖写操作,请参阅 [临时分区文档](../delete/table-temp-partition)。 +在某些情况下,用户希望重写表数据,但如果先删除再导入,会有一段时间无法查看数据。此时,用户可以先使用 `CREATE TABLE LIKE` 语句创建一个相同结构的新表,将新数据导入新表后,通过替换操作原子替换旧表。分区级别的原子覆盖写操作,请参阅 [临时分区文档](../delete/table-temp-partition)。 ## 语法说明 @@ -42,32 +39,26 @@ ALTER TABLE [db.]tbl1 REPLACE WITH TABLE tbl2 将表 tbl1 替换为表 tbl2。 -如果 `swap` 参数为 `true`,则替换后,名称为 `tbl1` 表中的数据为原 `tbl2` 表中的数据。而名称为 `tbl2` 表中的数据为原 `tbl1` 表中的数据。即两张表数据发生了互换。 +如果 `swap` 参数为 `true`,替换后,tbl1 表中的数据为原 tbl2 表中的数据,tbl2 表中的数据为原 tbl1 表中的数据,即两张表数据互换。 -如果 `swap` 参数为 `false`,则替换后,名称为 `tbl1` 表中的数据为原 `tbl2` 表中的数据。而名称为 `tbl2` 表被删除。 +如果 `swap` 参数为 `false`,替换后,tbl1 表中的数据为原 tbl2 表中的数据,tbl2 表被删除。 ## 原理 -替换表功能,实际上是将以下操作集合变成一个原子操作。 +替换表功能将以下操作集合变成一个原子操作。 -假设要将表 A 替换为表 B,且 `swap` 为 `true`,则操作如下: +假设将表 A 替换为表 B,且 `swap` 为 `true`,操作如下: -1. 将表 B 重名为表 A。 +1. 将表 B 重命名为表 A。 +2. 将表 A 重命名为表 B。 -2. 将表 A 重名为表 B。 - -如果 `swap` 为 `false`,则操作如下: +如果 `swap` 为 `false`,操作如下: 1. 删除表 A。 - -2. 将表 B 重名为表 A。 +2. 将表 B 重命名为表 A。 ## 注意事项 -- `swap` 参数默认为 `true`。即替换表操作相当于将两张表数据进行交换。 - -- 如果设置 `swap` 参数为 `false`,则被替换的表(表 A)将被删除,且无法恢复。 - -- 替换操作仅能发生在两张 OLAP 表之间,且不会检查两张表的表结构是否一致。 - -- 替换操作不会改变原有的权限设置。因为权限检查以表名称为准。 \ No newline at end of file +- 如果 `swap` 参数为 `false`,被替换的表(表 A)将被删除,且无法恢复。 +- 替换操作仅能发生在两张 OLAP 表之间,不检查两张表的表结构是否一致。 +- 替换操作不会改变原有的权限设置,因为权限检查以表名称为准。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/data-operate/delete/atomicity-replace.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/data-operate/delete/atomicity-replace.md index 807181b8869..55ee145c211 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/data-operate/delete/atomicity-replace.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/data-operate/delete/atomicity-replace.md @@ -24,14 +24,11 @@ specific language governing permissions and limitations under the License. --> - -Doris 支持对两个表进行原子的替换操作。该操作仅适用于 OLAP 表。 +Doris 支持对两个表进行原子替换操作,仅适用于 OLAP 表。 ## 适用场景 -- 原子的覆盖写操作 - -- 某些情况下,用户希望能够重写某张表的数据,但如果采用先删除再导入的方式进行,在中间会有一段时间无法查看数据。这时,用户可以先使用 `CREATE TABLE LIKE` 语句创建一个相同结构的新表,将新的数据导入到新表后,通过替换操作,原子的替换旧表,以达到目的。分区级别的原子覆盖写操作,请参阅 [临时分区文档](../delete/table-temp-partition)。 +在某些情况下,用户希望重写表数据,但如果先删除再导入,会有一段时间无法查看数据。此时,用户可以先使用 `CREATE TABLE LIKE` 语句创建一个相同结构的新表,将新数据导入新表后,通过替换操作原子替换旧表。分区级别的原子覆盖写操作,请参阅 [临时分区文档](../delete/table-temp-partition)。 ## 语法说明 @@ -42,32 +39,26 @@ ALTER TABLE [db.]tbl1 REPLACE WITH TABLE tbl2 将表 tbl1 替换为表 tbl2。 -如果 `swap` 参数为 `true`,则替换后,名称为 `tbl1` 表中的数据为原 `tbl2` 表中的数据。而名称为 `tbl2` 表中的数据为原 `tbl1` 表中的数据。即两张表数据发生了互换。 +如果 `swap` 参数为 `true`,替换后,tbl1 表中的数据为原 tbl2 表中的数据,tbl2 表中的数据为原 tbl1 表中的数据,即两张表数据互换。 -如果 `swap` 参数为 `false`,则替换后,名称为 `tbl1` 表中的数据为原 `tbl2` 表中的数据。而名称为 `tbl2` 表被删除。 +如果 `swap` 参数为 `false`,替换后,tbl1 表中的数据为原 tbl2 表中的数据,tbl2 表被删除。 ## 原理 -替换表功能,实际上是将以下操作集合变成一个原子操作。 +替换表功能将以下操作集合变成一个原子操作。 -假设要将表 A 替换为表 B,且 `swap` 为 `true`,则操作如下: +假设将表 A 替换为表 B,且 `swap` 为 `true`,操作如下: -1. 将表 B 重名为表 A。 +1. 将表 B 重命名为表 A。 +2. 将表 A 重命名为表 B。 -2. 将表 A 重名为表 B。 - -如果 `swap` 为 `false`,则操作如下: +如果 `swap` 为 `false`,操作如下: 1. 删除表 A。 - -2. 将表 B 重名为表 A。 +2. 将表 B 重命名为表 A。 ## 注意事项 -- `swap` 参数默认为 `true`。即替换表操作相当于将两张表数据进行交换。 - -- 如果设置 `swap` 参数为 `false`,则被替换的表(表 A)将被删除,且无法恢复。 - -- 替换操作仅能发生在两张 OLAP 表之间,且不会检查两张表的表结构是否一致。 - -- 替换操作不会改变原有的权限设置。因为权限检查以表名称为准。 \ No newline at end of file +- 如果 `swap` 参数为 `false`,被替换的表(表 A)将被删除,且无法恢复。 +- 替换操作仅能发生在两张 OLAP 表之间,不检查两张表的表结构是否一致。 +- 替换操作不会改变原有的权限设置,因为权限检查以表名称为准。 diff --git a/versioned_docs/version-2.1/data-operate/delete/atomicity-replace.md b/versioned_docs/version-2.1/data-operate/delete/atomicity-replace.md index 2c3a7358771..9876e95167b 100644 --- a/versioned_docs/version-2.1/data-operate/delete/atomicity-replace.md +++ b/versioned_docs/version-2.1/data-operate/delete/atomicity-replace.md @@ -24,14 +24,11 @@ specific language governing permissions and limitations under the License. --> -# Atomicity Replace +Doris supports atomic replacement operations between two tables, applicable only to OLAP tables. -Doris supports atomic table replacement operations for two tables. This is only applicable to OLAP tables. +## Applicable Scenarios -## Applicable scenarios - -- Atomic overwrite operations -- In certain cases, users may want to rewrite data in a table. However, the "delete and load" approach causes a data invisibility window. To solve that, Doris allows users to create a new table of the same schema using the CREATE TABLE LIKE statement, import the new data into this new table, and then atomically replace the old table with the new table. For atomic replacement at the partition level, please refer to the [temporary partition](../../data-operate/delete/table-temp-partition/) [...] +Sometimes, users need to rewrite table data, but deleting and then importing the data would result in a period of unavailability. In such cases, users can create a new table with the same structure using the `CREATE TABLE LIKE` statement, import the new data into the new table, and then perform an atomic replacement of the old table. For partition-level atomic overwrite operations, refer to the [temporary partition documentation](../delete/table-temp-partition). ## Syntax @@ -40,29 +37,28 @@ ALTER TABLE [db.]tbl1 REPLACE WITH TABLE tbl2 [PROPERTIES('swap' = 'true')]; ``` -Replace table tbl1 with table tbl2. +Replace table `tbl1` with table `tbl2`. -If `swap` is `true`, after the replacement, data in `tbl1` will be replaced by that in `tbl2`, while data in `tbl2` will be replaced by that in `tbl1`. In other words, the two tables will swap data. +If the `swap` parameter is `true`, after the replacement, the data in `tbl1` will be the original data in `tbl2`, and the data in `tbl2` will be the original data in `tbl1`, meaning the data in the two tables will be swapped. -If `swap` is `false`, after the replacement, data in `tbl1` will be replaced by that in `tbl2` and `tbl2` will be deleted. +If the `swap` parameter is `false`, after the replacement, the data in `tbl1` will be the original data in `tbl2`, and `tbl2` will be deleted. -## Implementation +## Principle -In fact, table replacement is to combine the following operations into one atomic operation. +The table replacement function turns the following set of operations into an atomic operation. -Assuming that table A is to be replaced with table B, and `swap` is set to `true`. The operations to be implemented are as follows: +Assuming table A is replaced with table B, and `swap` is `true`, the operations are as follows: 1. Rename table B to table A. 2. Rename table A to table B. -If `swap` is set to `false`, the operations are as follows: +If `swap` is `false`, the operations are as follows: 1. Delete table A. 2. Rename table B to table A. -## Note +## Notes -- `swap` defaults to `true`, meaning to swap the data between two tables. -- If `swap` is set to `false`, the table being replaced (table A) will be deleted and cannot be recovered. -- The replacement operation can only be implemented between two OLAP tables and it does not check for table schema consistency. -- The replacement operation does not change the existing privilege settings because privilege checks are based on table names. +- If the `swap` parameter is `false`, the replaced table (table A) will be deleted and cannot be recovered. +- The replacement operation can only occur between two OLAP tables and does not check if the table structures are consistent. +- The replacement operation will not change the original permission settings, as permission checks are based on table names. \ No newline at end of file diff --git a/versioned_docs/version-3.0/data-operate/delete/atomicity-replace.md b/versioned_docs/version-3.0/data-operate/delete/atomicity-replace.md index 2c3a7358771..9876e95167b 100644 --- a/versioned_docs/version-3.0/data-operate/delete/atomicity-replace.md +++ b/versioned_docs/version-3.0/data-operate/delete/atomicity-replace.md @@ -24,14 +24,11 @@ specific language governing permissions and limitations under the License. --> -# Atomicity Replace +Doris supports atomic replacement operations between two tables, applicable only to OLAP tables. -Doris supports atomic table replacement operations for two tables. This is only applicable to OLAP tables. +## Applicable Scenarios -## Applicable scenarios - -- Atomic overwrite operations -- In certain cases, users may want to rewrite data in a table. However, the "delete and load" approach causes a data invisibility window. To solve that, Doris allows users to create a new table of the same schema using the CREATE TABLE LIKE statement, import the new data into this new table, and then atomically replace the old table with the new table. For atomic replacement at the partition level, please refer to the [temporary partition](../../data-operate/delete/table-temp-partition/) [...] +Sometimes, users need to rewrite table data, but deleting and then importing the data would result in a period of unavailability. In such cases, users can create a new table with the same structure using the `CREATE TABLE LIKE` statement, import the new data into the new table, and then perform an atomic replacement of the old table. For partition-level atomic overwrite operations, refer to the [temporary partition documentation](../delete/table-temp-partition). ## Syntax @@ -40,29 +37,28 @@ ALTER TABLE [db.]tbl1 REPLACE WITH TABLE tbl2 [PROPERTIES('swap' = 'true')]; ``` -Replace table tbl1 with table tbl2. +Replace table `tbl1` with table `tbl2`. -If `swap` is `true`, after the replacement, data in `tbl1` will be replaced by that in `tbl2`, while data in `tbl2` will be replaced by that in `tbl1`. In other words, the two tables will swap data. +If the `swap` parameter is `true`, after the replacement, the data in `tbl1` will be the original data in `tbl2`, and the data in `tbl2` will be the original data in `tbl1`, meaning the data in the two tables will be swapped. -If `swap` is `false`, after the replacement, data in `tbl1` will be replaced by that in `tbl2` and `tbl2` will be deleted. +If the `swap` parameter is `false`, after the replacement, the data in `tbl1` will be the original data in `tbl2`, and `tbl2` will be deleted. -## Implementation +## Principle -In fact, table replacement is to combine the following operations into one atomic operation. +The table replacement function turns the following set of operations into an atomic operation. -Assuming that table A is to be replaced with table B, and `swap` is set to `true`. The operations to be implemented are as follows: +Assuming table A is replaced with table B, and `swap` is `true`, the operations are as follows: 1. Rename table B to table A. 2. Rename table A to table B. -If `swap` is set to `false`, the operations are as follows: +If `swap` is `false`, the operations are as follows: 1. Delete table A. 2. Rename table B to table A. -## Note +## Notes -- `swap` defaults to `true`, meaning to swap the data between two tables. -- If `swap` is set to `false`, the table being replaced (table A) will be deleted and cannot be recovered. -- The replacement operation can only be implemented between two OLAP tables and it does not check for table schema consistency. -- The replacement operation does not change the existing privilege settings because privilege checks are based on table names. +- If the `swap` parameter is `false`, the replaced table (table A) will be deleted and cannot be recovered. +- The replacement operation can only occur between two OLAP tables and does not check if the table structures are consistent. +- The replacement operation will not change the original permission settings, as permission checks are based on table names. \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org