This is an automated email from the ASF dual-hosted git repository. dataroaring 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 b25ddc8f6d [doc](update/delete) update documents of update and delete operations (#1303) b25ddc8f6d is described below commit b25ddc8f6d4723bd03ad6421b13fc16d6f6aca3b Author: zhannngchen <48427519+zhannngc...@users.noreply.github.com> AuthorDate: Wed Nov 6 19:31:20 2024 +0800 [doc](update/delete) update documents of update and delete operations (#1303) # Versions - [x] dev - [x] 3.0 - [x] 2.1 - [x] 2.0 # Languages - [x] Chinese - [x] English --------- Co-authored-by: Chen Zhang <zhangc...@selectdb.com> --- docs/data-operate/delete/batch-delete-manual.md | 14 +++++++------- .../current/data-operate/delete/batch-delete-manual.md | 16 ++++++++-------- .../data-operate/delete/batch-delete-manual.md | 18 +++++++++--------- .../data-operate/delete/batch-delete-manual.md | 16 ++++++++-------- .../data-operate/delete/batch-delete-manual.md | 16 ++++++++-------- .../data-operate/delete/batch-delete-manual.md | 14 +++++++------- .../data-operate/delete/batch-delete-manual.md | 14 +++++++------- .../data-operate/delete/batch-delete-manual.md | 14 +++++++------- 8 files changed, 61 insertions(+), 61 deletions(-) diff --git a/docs/data-operate/delete/batch-delete-manual.md b/docs/data-operate/delete/batch-delete-manual.md index 6ce1610464..da98250819 100644 --- a/docs/data-operate/delete/batch-delete-manual.md +++ b/docs/data-operate/delete/batch-delete-manual.md @@ -34,7 +34,7 @@ When you delete by Delete statement, each execution of Delete generates an empty For scenarios like importing data from a transactional database via CDC, Insert and Delete are usually interspersed in the data. In this case, the current Delete operation cannot be implemented. -Based on imported data, there are three ways the data can be merged: +When importing data, there are several ways to merge it: 1. APPEND: Append all data to existing data. @@ -48,9 +48,9 @@ Batch Delete only works on Unique models. ## Fundamental -This is achieved by adding a hidden column `DORIS_DELETE_SIGN` to the Unique table. +This is achieved by adding a hidden column `__DORIS_DELETE_SIGN__` to the Unique table. -When FE parses the query, `DORIS_DELETE_SIGN` is removed when it encounters * and so on, and `DORIS_DELETE_SIGN !` `= true`, BE will add a column for judgement when reading, and determine whether to delete by the condition. +When FE parses the query, `__DORIS_DELETE_SIGN__` is removed when it encounters * and so on, and `__DORIS_DELETE_SIGN__ !` `= true`, BE will add a column for judgement when reading, and determine whether to delete by the condition. - Import @@ -58,7 +58,7 @@ When FE parses the query, `DORIS_DELETE_SIGN` is removed when it encounters * an - Read - The read adds `DORIS_DELETE_SIGN !` `= true` condition, BE does not sense this process and executes normally. + The read adds `__DORIS_DELETE_SIGN__ !` `= true` condition, BE does not sense this process and executes normally. - Cumulative Compaction @@ -285,8 +285,8 @@ mysql> DESC table1; | name | VARCHAR(100) | No | true | NULL | | | gender | VARCHAR(10) | Yes | false | NULL | REPLACE | | age | INT | Yes | false | NULL | REPLACE | - | DORIS_DELETE_SIGN | TINYINT | No | false | 0 | REPLACE | - | DORIS_SEQUENCE_COL | INT | Yes | false | NULL | REPLACE | + | __DORIS_DELETE_SIGN__ | TINYINT | No | false | 0 | REPLACE | + | __DORIS_SEQUENCE_COL__ | INT | Yes | false | NULL | REPLACE | +------------------------+--------------+------+-------+---------+---------+ 4 rows in set (0.00 sec) ``` @@ -350,7 +350,7 @@ mysql> DESC table1; li,male,10 ``` - This is because in the underlying dependencies, it will first judge the case of the same key, display the row data with a large value in the sequence column, and then check whether the `DORIS_DELETE_SIGN` value of the row is 1. If it is 1, it will not be displayed. If it is 0, it will still be read out. + This is because in the underlying dependencies, it will first judge the case of the same key, display the row data with a large value in the sequence column, and then check whether the `__DORIS_DELETE_SIGN__` value of the row is 1. If it is 1, it will not be displayed. If it is 0, it will still be read out. :::tip Tip When data is written and deleted at the same time in the imported data (e.g., in the Flink CDC scenario), using the sequence column can effectively ensure consistency when the data arrives out of order, avoiding the deletion operation of an old version that arrives later, and accidentally deleting the new version of the data that arrives first. diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/data-operate/delete/batch-delete-manual.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/data-operate/delete/batch-delete-manual.md index d1223ef850..a48d1fceff 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/data-operate/delete/batch-delete-manual.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/data-operate/delete/batch-delete-manual.md @@ -33,7 +33,7 @@ under the License. 对于类似于从事务数据库中,通过 CDC 进行数据导入的场景,数据中 Insert 和 Delete 一般是穿插出现的,面对这种场景当前 Delete 操作也是无法实现。 -基于数据导入的方式,数据有三种合并方式: +导入数据时有几种合并方式: 1. APPEND: 数据全部追加到现有数据中。 @@ -45,9 +45,9 @@ under the License. ## 基本原理 -通过在 Unique 表上增加一个隐藏列`DORIS_DELETE_SIGN`来实现。 +通过在 Unique 表上增加一个隐藏列`__DORIS_DELETE_SIGN__`来实现。 -FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默认加上 `DORIS_DELETE_SIGN != true` 的条件,BE 读取时都会加上一列进行判断,通过条件确定是否删除。 +FE 解析查询时,遇到 * 等扩展时去掉`__DORIS_DELETE_SIGN__`,并且默认加上 `__DORIS_DELETE_SIGN__ != true` 的条件,BE 读取时都会加上一列进行判断,通过条件确定是否删除。 - 导入 @@ -55,7 +55,7 @@ FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默 - 读取 - 读取时在所有存在隐藏列的上增加`DORIS_DELETE_SIGN != true` 的条件,be 不感知这一过程,正常执行。 + 读取时在所有存在隐藏列的上增加`__DORIS_DELETE_SIGN__ != true` 的条件,be 不感知这一过程,正常执行。 - Cumulative Compaction @@ -265,7 +265,7 @@ curl --location-trusted -u root: -H "column_separator:," -H "columns: siteid, ci curl --location-trusted -u root: -H "column_separator:," -H "columns: name, gender, age" -H "function_column.sequence_col: age" -H "merge_type: DELETE" -T ~/table1_data http://127.0.0.1:8030/api/test/table1/_stream_load ``` -当 Unique 表设置了 Sequence 列时,在相同 Key 列下,Sequence 列的值会作为 REPLACE 聚合函数替换顺序的依据,较大值可以替换较小值。当对这种表基于`DORIS_DELETE_SIGN`进行删除标记时,需要保证 Key 相同和 Sequence 列值要大于等于当前值。 +当 Unique 表设置了 Sequence 列时,在相同 Key 列下,Sequence 列的值会作为 REPLACE 聚合函数替换顺序的依据,较大值可以替换较小值。当对这种表基于`__DORIS_DELETE_SIGN__`进行删除标记时,需要保证 Key 相同和 Sequence 列值要大于等于当前值。 假设有表,结构如下 @@ -280,8 +280,8 @@ mysql DESC table1; | name | VARCHAR(100) | No | true | NULL | | | gender | VARCHAR(10) | Yes | false | NULL | REPLACE | | age | INT | Yes | false | NULL | REPLACE | -| DORIS_DELETE_SIGN | TINYINT | No | false | 0 | REPLACE | -| DORIS_SEQUENCE_COL | INT | Yes | false | NULL | REPLACE | +| __DORIS_DELETE_SIGN__ | TINYINT | No | false | 0 | REPLACE | +| __DORIS_SEQUENCE_COL__ | INT | Yes | false | NULL | REPLACE | +------------------------+--------------+------+-------+---------+---------+ 4 rows in set (0.00 sec) ``` @@ -347,6 +347,6 @@ li,male,9 li,male,10 ``` -并没有被删除,这是因为在底层的依赖关系上,会先判断 key 相同的情况,对外展示 sequence 列的值大的行数据,然后在看该行的`DORIS_DELETE_SIGN`值是否为 1,如果为 1 则不会对外展示,如果为 0,则仍会读出来。 +并没有被删除,这是因为在底层的依赖关系上,会先判断 key 相同的情况,对外展示 sequence 列的值大的行数据,然后在看该行的`__DORIS_DELETE_SIGN__`值是否为 1,如果为 1 则不会对外展示,如果为 0,则仍会读出来。 当导入数据中同时存在数据写入和删除时(例如 CDC 场景中),使用 Sequence 列可以有效的保证当数据乱序到达时的一致性,避免后到达的一个旧版本的删除操作,误删掉了先到达的新版本的数据。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/data-operate/delete/batch-delete-manual.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/data-operate/delete/batch-delete-manual.md index 66954111c9..bf08dc8a31 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/data-operate/delete/batch-delete-manual.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/data-operate/delete/batch-delete-manual.md @@ -33,7 +33,7 @@ under the License. 对于类似于从事务数据库中,通过 CDC 进行数据导入的场景,数据中 Insert 和 Delete 一般是穿插出现的,面对这种场景当前 Delete 操作也是无法实现。 -基于数据导入的方式,数据有三种合并方式: +导入数据时有几种合并方式: 1. APPEND: 数据全部追加到现有数据中。 @@ -45,9 +45,9 @@ under the License. ## 基本原理 -通过在 Unique 表上增加一个隐藏列`DORIS_DELETE_SIGN`来实现。 +通过在 Unique 表上增加一个隐藏列`__DORIS_DELETE_SIGN__`来实现。 -FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默认加上 `DORIS_DELETE_SIGN != true` 的条件,BE 读取时都会加上一列进行判断,通过条件确定是否删除。 +FE 解析查询时,遇到 * 等扩展时去掉`__DORIS_DELETE_SIGN__`,并且默认加上 `__DORIS_DELETE_SIGN__ != true` 的条件,BE 读取时都会加上一列进行判断,通过条件确定是否删除。 - 导入 @@ -55,7 +55,7 @@ FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默 - 读取 - 读取时在所有存在隐藏列的上增加`DORIS_DELETE_SIGN != true` 的条件,be 不感知这一过程,正常执行。 + 读取时在所有存在隐藏列的上增加`__DORIS_DELETE_SIGN__ != true` 的条件,be 不感知这一过程,正常执行。 - Cumulative Compaction @@ -73,7 +73,7 @@ FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默 2. 对于没有更改上述 FE 配置或对于已存在的不支持批量删除功能的表,可以使用如下语句: `ALTER TABLE tablename ENABLE FEATURE "BATCH_DELETE"` 来启用批量删除。本操作本质上是一个 schema change 操作,操作立即返回,可以通过`show alter table column` 来确认操作是否完成。 -那么如何确定一个表是否支持批量删除,可以通过设置一个 session variable 来显示隐藏列 `SET show_hidden_columns=true` ,之后使用`desc tablename`,如果输出中有`DORIS_DELETE_SIGN` 列则支持,如果没有则不支持。 +那么如何确定一个表是否支持批量删除,可以通过设置一个 session variable 来显示隐藏列 `SET show_hidden_columns=true` ,之后使用`desc tablename`,如果输出中有`__DORIS_DELETE_SIGN__` 列则支持,如果没有则不支持。 ## 语法说明 @@ -275,7 +275,7 @@ curl --location-trusted -u root: -H "column_separator:," -H "columns: siteid, ci curl --location-trusted -u root: -H "column_separator:," -H "columns: name, gender, age" -H "function_column.sequence_col: age" -H "merge_type: DELETE" -T ~/table1_data http://127.0.0.1:8030/api/test/table1/_stream_load ``` -当 Unique 表设置了 Sequence 列时,在相同 Key 列下,Sequence 列的值会作为 REPLACE 聚合函数替换顺序的依据,较大值可以替换较小值。当对这种表基于`DORIS_DELETE_SIGN`进行删除标记时,需要保证 Key 相同和 Sequence 列值要大于等于当前值。 +当 Unique 表设置了 Sequence 列时,在相同 Key 列下,Sequence 列的值会作为 REPLACE 聚合函数替换顺序的依据,较大值可以替换较小值。当对这种表基于`__DORIS_DELETE_SIGN__`进行删除标记时,需要保证 Key 相同和 Sequence 列值要大于等于当前值。 假设有表,结构如下 @@ -290,8 +290,8 @@ mysql DESC table1; | name | VARCHAR(100) | No | true | NULL | | | gender | VARCHAR(10) | Yes | false | NULL | REPLACE | | age | INT | Yes | false | NULL | REPLACE | -| DORIS_DELETE_SIGN | TINYINT | No | false | 0 | REPLACE | -| DORIS_SEQUENCE_COL | INT | Yes | false | NULL | REPLACE | +| __DORIS_DELETE_SIGN__ | TINYINT | No | false | 0 | REPLACE | +| __DORIS_SEQUENCE_COL__ | INT | Yes | false | NULL | REPLACE | +------------------------+--------------+------+-------+---------+---------+ 4 rows in set (0.00 sec) ``` @@ -357,6 +357,6 @@ li,male,9 li,male,10 ``` -并没有被删除,这是因为在底层的依赖关系上,会先判断 key 相同的情况,对外展示 sequence 列的值大的行数据,然后在看该行的`DORIS_DELETE_SIGN`值是否为 1,如果为 1 则不会对外展示,如果为 0,则仍会读出来。 +并没有被删除,这是因为在底层的依赖关系上,会先判断 key 相同的情况,对外展示 sequence 列的值大的行数据,然后在看该行的`__DORIS_DELETE_SIGN__`值是否为 1,如果为 1 则不会对外展示,如果为 0,则仍会读出来。 当导入数据中同时存在数据写入和删除时(例如 CDC 场景中),使用 Sequence 列可以有效的保证当数据乱序到达时的一致性,避免后到达的一个旧版本的删除操作,误删掉了先到达的新版本的数据。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/data-operate/delete/batch-delete-manual.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/data-operate/delete/batch-delete-manual.md index d1223ef850..a48d1fceff 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/data-operate/delete/batch-delete-manual.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/data-operate/delete/batch-delete-manual.md @@ -33,7 +33,7 @@ under the License. 对于类似于从事务数据库中,通过 CDC 进行数据导入的场景,数据中 Insert 和 Delete 一般是穿插出现的,面对这种场景当前 Delete 操作也是无法实现。 -基于数据导入的方式,数据有三种合并方式: +导入数据时有几种合并方式: 1. APPEND: 数据全部追加到现有数据中。 @@ -45,9 +45,9 @@ under the License. ## 基本原理 -通过在 Unique 表上增加一个隐藏列`DORIS_DELETE_SIGN`来实现。 +通过在 Unique 表上增加一个隐藏列`__DORIS_DELETE_SIGN__`来实现。 -FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默认加上 `DORIS_DELETE_SIGN != true` 的条件,BE 读取时都会加上一列进行判断,通过条件确定是否删除。 +FE 解析查询时,遇到 * 等扩展时去掉`__DORIS_DELETE_SIGN__`,并且默认加上 `__DORIS_DELETE_SIGN__ != true` 的条件,BE 读取时都会加上一列进行判断,通过条件确定是否删除。 - 导入 @@ -55,7 +55,7 @@ FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默 - 读取 - 读取时在所有存在隐藏列的上增加`DORIS_DELETE_SIGN != true` 的条件,be 不感知这一过程,正常执行。 + 读取时在所有存在隐藏列的上增加`__DORIS_DELETE_SIGN__ != true` 的条件,be 不感知这一过程,正常执行。 - Cumulative Compaction @@ -265,7 +265,7 @@ curl --location-trusted -u root: -H "column_separator:," -H "columns: siteid, ci curl --location-trusted -u root: -H "column_separator:," -H "columns: name, gender, age" -H "function_column.sequence_col: age" -H "merge_type: DELETE" -T ~/table1_data http://127.0.0.1:8030/api/test/table1/_stream_load ``` -当 Unique 表设置了 Sequence 列时,在相同 Key 列下,Sequence 列的值会作为 REPLACE 聚合函数替换顺序的依据,较大值可以替换较小值。当对这种表基于`DORIS_DELETE_SIGN`进行删除标记时,需要保证 Key 相同和 Sequence 列值要大于等于当前值。 +当 Unique 表设置了 Sequence 列时,在相同 Key 列下,Sequence 列的值会作为 REPLACE 聚合函数替换顺序的依据,较大值可以替换较小值。当对这种表基于`__DORIS_DELETE_SIGN__`进行删除标记时,需要保证 Key 相同和 Sequence 列值要大于等于当前值。 假设有表,结构如下 @@ -280,8 +280,8 @@ mysql DESC table1; | name | VARCHAR(100) | No | true | NULL | | | gender | VARCHAR(10) | Yes | false | NULL | REPLACE | | age | INT | Yes | false | NULL | REPLACE | -| DORIS_DELETE_SIGN | TINYINT | No | false | 0 | REPLACE | -| DORIS_SEQUENCE_COL | INT | Yes | false | NULL | REPLACE | +| __DORIS_DELETE_SIGN__ | TINYINT | No | false | 0 | REPLACE | +| __DORIS_SEQUENCE_COL__ | INT | Yes | false | NULL | REPLACE | +------------------------+--------------+------+-------+---------+---------+ 4 rows in set (0.00 sec) ``` @@ -347,6 +347,6 @@ li,male,9 li,male,10 ``` -并没有被删除,这是因为在底层的依赖关系上,会先判断 key 相同的情况,对外展示 sequence 列的值大的行数据,然后在看该行的`DORIS_DELETE_SIGN`值是否为 1,如果为 1 则不会对外展示,如果为 0,则仍会读出来。 +并没有被删除,这是因为在底层的依赖关系上,会先判断 key 相同的情况,对外展示 sequence 列的值大的行数据,然后在看该行的`__DORIS_DELETE_SIGN__`值是否为 1,如果为 1 则不会对外展示,如果为 0,则仍会读出来。 当导入数据中同时存在数据写入和删除时(例如 CDC 场景中),使用 Sequence 列可以有效的保证当数据乱序到达时的一致性,避免后到达的一个旧版本的删除操作,误删掉了先到达的新版本的数据。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/data-operate/delete/batch-delete-manual.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/data-operate/delete/batch-delete-manual.md index d1223ef850..a48d1fceff 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/data-operate/delete/batch-delete-manual.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/data-operate/delete/batch-delete-manual.md @@ -33,7 +33,7 @@ under the License. 对于类似于从事务数据库中,通过 CDC 进行数据导入的场景,数据中 Insert 和 Delete 一般是穿插出现的,面对这种场景当前 Delete 操作也是无法实现。 -基于数据导入的方式,数据有三种合并方式: +导入数据时有几种合并方式: 1. APPEND: 数据全部追加到现有数据中。 @@ -45,9 +45,9 @@ under the License. ## 基本原理 -通过在 Unique 表上增加一个隐藏列`DORIS_DELETE_SIGN`来实现。 +通过在 Unique 表上增加一个隐藏列`__DORIS_DELETE_SIGN__`来实现。 -FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默认加上 `DORIS_DELETE_SIGN != true` 的条件,BE 读取时都会加上一列进行判断,通过条件确定是否删除。 +FE 解析查询时,遇到 * 等扩展时去掉`__DORIS_DELETE_SIGN__`,并且默认加上 `__DORIS_DELETE_SIGN__ != true` 的条件,BE 读取时都会加上一列进行判断,通过条件确定是否删除。 - 导入 @@ -55,7 +55,7 @@ FE 解析查询时,遇到 * 等扩展时去掉`DORIS_DELETE_SIGN`,并且默 - 读取 - 读取时在所有存在隐藏列的上增加`DORIS_DELETE_SIGN != true` 的条件,be 不感知这一过程,正常执行。 + 读取时在所有存在隐藏列的上增加`__DORIS_DELETE_SIGN__ != true` 的条件,be 不感知这一过程,正常执行。 - Cumulative Compaction @@ -265,7 +265,7 @@ curl --location-trusted -u root: -H "column_separator:," -H "columns: siteid, ci curl --location-trusted -u root: -H "column_separator:," -H "columns: name, gender, age" -H "function_column.sequence_col: age" -H "merge_type: DELETE" -T ~/table1_data http://127.0.0.1:8030/api/test/table1/_stream_load ``` -当 Unique 表设置了 Sequence 列时,在相同 Key 列下,Sequence 列的值会作为 REPLACE 聚合函数替换顺序的依据,较大值可以替换较小值。当对这种表基于`DORIS_DELETE_SIGN`进行删除标记时,需要保证 Key 相同和 Sequence 列值要大于等于当前值。 +当 Unique 表设置了 Sequence 列时,在相同 Key 列下,Sequence 列的值会作为 REPLACE 聚合函数替换顺序的依据,较大值可以替换较小值。当对这种表基于`__DORIS_DELETE_SIGN__`进行删除标记时,需要保证 Key 相同和 Sequence 列值要大于等于当前值。 假设有表,结构如下 @@ -280,8 +280,8 @@ mysql DESC table1; | name | VARCHAR(100) | No | true | NULL | | | gender | VARCHAR(10) | Yes | false | NULL | REPLACE | | age | INT | Yes | false | NULL | REPLACE | -| DORIS_DELETE_SIGN | TINYINT | No | false | 0 | REPLACE | -| DORIS_SEQUENCE_COL | INT | Yes | false | NULL | REPLACE | +| __DORIS_DELETE_SIGN__ | TINYINT | No | false | 0 | REPLACE | +| __DORIS_SEQUENCE_COL__ | INT | Yes | false | NULL | REPLACE | +------------------------+--------------+------+-------+---------+---------+ 4 rows in set (0.00 sec) ``` @@ -347,6 +347,6 @@ li,male,9 li,male,10 ``` -并没有被删除,这是因为在底层的依赖关系上,会先判断 key 相同的情况,对外展示 sequence 列的值大的行数据,然后在看该行的`DORIS_DELETE_SIGN`值是否为 1,如果为 1 则不会对外展示,如果为 0,则仍会读出来。 +并没有被删除,这是因为在底层的依赖关系上,会先判断 key 相同的情况,对外展示 sequence 列的值大的行数据,然后在看该行的`__DORIS_DELETE_SIGN__`值是否为 1,如果为 1 则不会对外展示,如果为 0,则仍会读出来。 当导入数据中同时存在数据写入和删除时(例如 CDC 场景中),使用 Sequence 列可以有效的保证当数据乱序到达时的一致性,避免后到达的一个旧版本的删除操作,误删掉了先到达的新版本的数据。 diff --git a/versioned_docs/version-2.0/data-operate/delete/batch-delete-manual.md b/versioned_docs/version-2.0/data-operate/delete/batch-delete-manual.md index df5971cbde..5587792ab2 100644 --- a/versioned_docs/version-2.0/data-operate/delete/batch-delete-manual.md +++ b/versioned_docs/version-2.0/data-operate/delete/batch-delete-manual.md @@ -34,7 +34,7 @@ When you delete by Delete statement, each execution of Delete generates an empty For scenarios like importing data from a transactional database via CDC, Insert and Delete are usually interspersed in the data. In this case, the current Delete operation cannot be implemented. -Based on imported data, there are three ways the data can be merged: +When importing data, there are several ways to merge it: 1. APPEND: Append all data to existing data. @@ -48,9 +48,9 @@ Batch Delete only works on Unique models. ## Fundamental -This is achieved by adding a hidden column `DORIS_DELETE_SIGN` to the Unique table. +This is achieved by adding a hidden column `__DORIS_DELETE_SIGN__` to the Unique table. -When FE parses the query, `DORIS_DELETE_SIGN` is removed when it encounters * and so on, and `DORIS_DELETE_SIGN !` `= true`, BE will add a column for judgement when reading, and determine whether to delete by the condition. +When FE parses the query, `__DORIS_DELETE_SIGN__` is removed when it encounters * and so on, and `__DORIS_DELETE_SIGN__ !` `= true`, BE will add a column for judgement when reading, and determine whether to delete by the condition. - Import @@ -58,7 +58,7 @@ When FE parses the query, `DORIS_DELETE_SIGN` is removed when it encounters * an - Read - The read adds `DORIS_DELETE_SIGN !` `= true` condition, BE does not sense this process and executes normally. + The read adds `__DORIS_DELETE_SIGN__ !` `= true` condition, BE does not sense this process and executes normally. - Cumulative Compaction @@ -76,7 +76,7 @@ There are two forms of enabling Batch Delete support: 2. For tables that do not have the above FE configuration changed or for existing tables that do not support Batch Delete, the following statement can be used: `ALTER TABLE tablename ENABLE FEATURE "BATCH_DELETE"` to enable Batch Delete. This is essentially a schema change operation, which returns immediately and can be confirmed by `showing alter table column`. -Then how to determine whether a table supports Batch Delete, you can set a session variable to show hidden columns `SET show_hidden_columns=true`, and after that use `desc tablename`, if there is a `DORIS_DELETE_SIGN` column in the output then it is supported, if there is not then it is not supported. +Then how to determine whether a table supports Batch Delete, you can set a session variable to show hidden columns `SET show_hidden_columns=true`, and after that use `desc tablename`, if there is a `__DORIS_DELETE_SIGN__` column in the output then it is supported, if there is not then it is not supported. ## Syntax Description @@ -295,8 +295,8 @@ mysql> DESC table1; | name | VARCHAR(100) | No | true | NULL | | | gender | VARCHAR(10) | Yes | false | NULL | REPLACE | | age | INT | Yes | false | NULL | REPLACE | - | DORIS_DELETE_SIGN | TINYINT | No | false | 0 | REPLACE | - | DORIS_SEQUENCE_COL | INT | Yes | false | NULL | REPLACE | + | __DORIS_DELETE_SIGN__ | TINYINT | No | false | 0 | REPLACE | + | __DORIS_SEQUENCE_COL__ | INT | Yes | false | NULL | REPLACE | +------------------------+--------------+------+-------+---------+---------+ 4 rows in set (0.00 sec) ``` diff --git a/versioned_docs/version-2.1/data-operate/delete/batch-delete-manual.md b/versioned_docs/version-2.1/data-operate/delete/batch-delete-manual.md index 6ce1610464..da98250819 100644 --- a/versioned_docs/version-2.1/data-operate/delete/batch-delete-manual.md +++ b/versioned_docs/version-2.1/data-operate/delete/batch-delete-manual.md @@ -34,7 +34,7 @@ When you delete by Delete statement, each execution of Delete generates an empty For scenarios like importing data from a transactional database via CDC, Insert and Delete are usually interspersed in the data. In this case, the current Delete operation cannot be implemented. -Based on imported data, there are three ways the data can be merged: +When importing data, there are several ways to merge it: 1. APPEND: Append all data to existing data. @@ -48,9 +48,9 @@ Batch Delete only works on Unique models. ## Fundamental -This is achieved by adding a hidden column `DORIS_DELETE_SIGN` to the Unique table. +This is achieved by adding a hidden column `__DORIS_DELETE_SIGN__` to the Unique table. -When FE parses the query, `DORIS_DELETE_SIGN` is removed when it encounters * and so on, and `DORIS_DELETE_SIGN !` `= true`, BE will add a column for judgement when reading, and determine whether to delete by the condition. +When FE parses the query, `__DORIS_DELETE_SIGN__` is removed when it encounters * and so on, and `__DORIS_DELETE_SIGN__ !` `= true`, BE will add a column for judgement when reading, and determine whether to delete by the condition. - Import @@ -58,7 +58,7 @@ When FE parses the query, `DORIS_DELETE_SIGN` is removed when it encounters * an - Read - The read adds `DORIS_DELETE_SIGN !` `= true` condition, BE does not sense this process and executes normally. + The read adds `__DORIS_DELETE_SIGN__ !` `= true` condition, BE does not sense this process and executes normally. - Cumulative Compaction @@ -285,8 +285,8 @@ mysql> DESC table1; | name | VARCHAR(100) | No | true | NULL | | | gender | VARCHAR(10) | Yes | false | NULL | REPLACE | | age | INT | Yes | false | NULL | REPLACE | - | DORIS_DELETE_SIGN | TINYINT | No | false | 0 | REPLACE | - | DORIS_SEQUENCE_COL | INT | Yes | false | NULL | REPLACE | + | __DORIS_DELETE_SIGN__ | TINYINT | No | false | 0 | REPLACE | + | __DORIS_SEQUENCE_COL__ | INT | Yes | false | NULL | REPLACE | +------------------------+--------------+------+-------+---------+---------+ 4 rows in set (0.00 sec) ``` @@ -350,7 +350,7 @@ mysql> DESC table1; li,male,10 ``` - This is because in the underlying dependencies, it will first judge the case of the same key, display the row data with a large value in the sequence column, and then check whether the `DORIS_DELETE_SIGN` value of the row is 1. If it is 1, it will not be displayed. If it is 0, it will still be read out. + This is because in the underlying dependencies, it will first judge the case of the same key, display the row data with a large value in the sequence column, and then check whether the `__DORIS_DELETE_SIGN__` value of the row is 1. If it is 1, it will not be displayed. If it is 0, it will still be read out. :::tip Tip When data is written and deleted at the same time in the imported data (e.g., in the Flink CDC scenario), using the sequence column can effectively ensure consistency when the data arrives out of order, avoiding the deletion operation of an old version that arrives later, and accidentally deleting the new version of the data that arrives first. diff --git a/versioned_docs/version-3.0/data-operate/delete/batch-delete-manual.md b/versioned_docs/version-3.0/data-operate/delete/batch-delete-manual.md index 6ce1610464..da98250819 100644 --- a/versioned_docs/version-3.0/data-operate/delete/batch-delete-manual.md +++ b/versioned_docs/version-3.0/data-operate/delete/batch-delete-manual.md @@ -34,7 +34,7 @@ When you delete by Delete statement, each execution of Delete generates an empty For scenarios like importing data from a transactional database via CDC, Insert and Delete are usually interspersed in the data. In this case, the current Delete operation cannot be implemented. -Based on imported data, there are three ways the data can be merged: +When importing data, there are several ways to merge it: 1. APPEND: Append all data to existing data. @@ -48,9 +48,9 @@ Batch Delete only works on Unique models. ## Fundamental -This is achieved by adding a hidden column `DORIS_DELETE_SIGN` to the Unique table. +This is achieved by adding a hidden column `__DORIS_DELETE_SIGN__` to the Unique table. -When FE parses the query, `DORIS_DELETE_SIGN` is removed when it encounters * and so on, and `DORIS_DELETE_SIGN !` `= true`, BE will add a column for judgement when reading, and determine whether to delete by the condition. +When FE parses the query, `__DORIS_DELETE_SIGN__` is removed when it encounters * and so on, and `__DORIS_DELETE_SIGN__ !` `= true`, BE will add a column for judgement when reading, and determine whether to delete by the condition. - Import @@ -58,7 +58,7 @@ When FE parses the query, `DORIS_DELETE_SIGN` is removed when it encounters * an - Read - The read adds `DORIS_DELETE_SIGN !` `= true` condition, BE does not sense this process and executes normally. + The read adds `__DORIS_DELETE_SIGN__ !` `= true` condition, BE does not sense this process and executes normally. - Cumulative Compaction @@ -285,8 +285,8 @@ mysql> DESC table1; | name | VARCHAR(100) | No | true | NULL | | | gender | VARCHAR(10) | Yes | false | NULL | REPLACE | | age | INT | Yes | false | NULL | REPLACE | - | DORIS_DELETE_SIGN | TINYINT | No | false | 0 | REPLACE | - | DORIS_SEQUENCE_COL | INT | Yes | false | NULL | REPLACE | + | __DORIS_DELETE_SIGN__ | TINYINT | No | false | 0 | REPLACE | + | __DORIS_SEQUENCE_COL__ | INT | Yes | false | NULL | REPLACE | +------------------------+--------------+------+-------+---------+---------+ 4 rows in set (0.00 sec) ``` @@ -350,7 +350,7 @@ mysql> DESC table1; li,male,10 ``` - This is because in the underlying dependencies, it will first judge the case of the same key, display the row data with a large value in the sequence column, and then check whether the `DORIS_DELETE_SIGN` value of the row is 1. If it is 1, it will not be displayed. If it is 0, it will still be read out. + This is because in the underlying dependencies, it will first judge the case of the same key, display the row data with a large value in the sequence column, and then check whether the `__DORIS_DELETE_SIGN__` value of the row is 1. If it is 1, it will not be displayed. If it is 0, it will still be read out. :::tip Tip When data is written and deleted at the same time in the imported data (e.g., in the Flink CDC scenario), using the sequence column can effectively ensure consistency when the data arrives out of order, avoiding the deletion operation of an old version that arrives later, and accidentally deleting the new version of the data that arrives first. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org