You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/01/09 00:38:51 UTC

[doris] branch master updated: [doc](export) add docs for cancel-export. (#15682)

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new fb1f6bdd82 [doc](export) add docs for cancel-export. (#15682)
fb1f6bdd82 is described below

commit fb1f6bdd82858d7ef35c402ad80fad635a6e977e
Author: wxy <du...@gmail.com>
AuthorDate: Mon Jan 9 08:38:45 2023 +0800

    [doc](export) add docs for cancel-export. (#15682)
    
    
    
    Co-authored-by: wangxiangyu@360shuke.com <wa...@360shuke.com>
---
 docs/en/docs/data-operate/export/export-manual.md  | 17 ++++-
 .../Manipulation/CANCEL-EXPORT.md                  | 80 ++++++++++++++++++++++
 docs/sidebars.json                                 |  3 +-
 .../docs/data-operate/export/export-manual.md      | 17 ++++-
 .../Manipulation/CANCEL-EXPORT.md                  | 80 ++++++++++++++++++++++
 5 files changed, 194 insertions(+), 3 deletions(-)

diff --git a/docs/en/docs/data-operate/export/export-manual.md b/docs/en/docs/data-operate/export/export-manual.md
index 4636436bd1..d7a2a7dd4c 100644
--- a/docs/en/docs/data-operate/export/export-manual.md
+++ b/docs/en/docs/data-operate/export/export-manual.md
@@ -153,7 +153,7 @@ EXPORT TABLE test TO "s3://bucket/path/to/export/dir/" WITH S3  (
 
 ### View export status
 
-After submitting a job, the job status can be imported by querying the   [SHOW EXPORT](../../sql-manual/sql-reference/Show-Statements/SHOW-EXPORT.md)  command. The results are as follows:
+After submitting a job, the job status can be viewed by querying the   [SHOW EXPORT](../../sql-manual/sql-reference/Show-Statements/SHOW-EXPORT.md)  command. The results are as follows:
 
 ```sql
 mysql> show EXPORT\G;
@@ -194,6 +194,20 @@ FinishTime: 2019-06-25 17:08:34
 * Timeout: Job timeout. The unit is seconds. This time is calculated from CreateTime.
 * Error Msg: If there is an error in the job, the cause of the error is shown here.
 
+<version since="dev">
+
+### Cancel export job
+
+After submitting a job, the job can be canceled by using the  [CANCEL EXPORT](../../sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT.md)  command. For example:
+
+```sql
+CANCEL EXPORT
+FROM example_db
+WHERE LABEL like "%example%";
+````
+
+</version>
+
 ## Best Practices
 
 ### Splitting Query Plans
@@ -223,6 +237,7 @@ Usually, a query plan for an Export job has only two parts `scan`- `export`, and
 * `export_running_job_num_limit `: Limit on the number of Export jobs running. If exceeded, the job will wait and be in PENDING state. The default is 5, which can be adjusted at run time.
 * `Export_task_default_timeout_second`: Export job default timeout time. The default is 2 hours. It can be adjusted at run time.
 * `export_tablet_num_per_task`: The maximum number of fragments that a query plan is responsible for. The default is 5.
+* `label`: The label of this Export job. Doris will generate a label for an Export job if this param is not set.
 
 ## More Help
 
diff --git a/docs/en/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT.md b/docs/en/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT.md
new file mode 100644
index 0000000000..04b97b28ef
--- /dev/null
+++ b/docs/en/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT.md
@@ -0,0 +1,80 @@
+---
+{
+    "title": "CANCEL-EXPORT",
+    "language": "en"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## CANCEL-EXPORT 
+
+### Name
+
+<version since="dev">
+
+CANCEL EXPORT 
+
+</version>
+
+### Description
+
+This statement is used to undo an export job for the specified label. Or batch undo export jobs via fuzzy matching
+
+```sql
+CANCEL EXPORT 
+[FROM db_name]
+WHERE [LABEL = "export_label" | LABEL like "label_pattern" | STATE = "PENDING/EXPORTING"]
+```
+
+### Example
+
+1. Cancel the export job whose label is `example_db_test_export_label` on the database example_db
+
+    ```sql
+    CANCEL EXPORT
+    FROM example_db
+    WHERE LABEL = "example_db_test_export_label";
+    ````
+
+2. Cancel all export jobs containing example* on the database example*db.
+
+    ```sql
+    CANCEL EXPORT
+    FROM example_db
+    WHERE LABEL like "%example%";
+    ````
+
+3. Cancel all export jobs which state are "PENDING"
+
+   ```sql
+   CANCEL EXPORT
+   FROM example_db
+   WHERE STATE = "PENDING";
+   ```
+
+### Keywords
+
+     CANCEL, EXPORT
+
+### Best Practice
+
+1. Only pending export jobs in PENDING, EXPORTING state can be canceled.
+2. When performing batch undo, Doris does not guarantee the atomic undo of all corresponding export jobs. That is, it is possible that only some of the export jobs were successfully undone. The user can view the job status through the SHOW EXPORT statement and try to execute the CANCEL EXPORT statement repeatedly.
diff --git a/docs/sidebars.json b/docs/sidebars.json
index aae2c94b20..3611017e5b 100644
--- a/docs/sidebars.json
+++ b/docs/sidebars.json
@@ -819,7 +819,8 @@
                                         "sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/SELECT",
                                         "sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/DELETE",
                                         "sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/UPDATE",
-                                        "sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/EXPORT"
+                                        "sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/EXPORT",
+                                        "sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT"
                                     ]
                                 },
                                 "sql-manual/sql-reference/Data-Manipulation-Statements/OUTFILE"
diff --git a/docs/zh-CN/docs/data-operate/export/export-manual.md b/docs/zh-CN/docs/data-operate/export/export-manual.md
index 754fa8f129..a26fd39411 100644
--- a/docs/zh-CN/docs/data-operate/export/export-manual.md
+++ b/docs/zh-CN/docs/data-operate/export/export-manual.md
@@ -147,7 +147,7 @@ EXPORT TABLE test TO "s3://bucket/path/to/export/dir/" WITH S3  (
 
 ### 查看导出状态
 
-提交作业后,可以通过  [SHOW EXPORT](../../sql-manual/sql-reference/Show-Statements/SHOW-EXPORT.md) 命令查询导入作业状态。结果举例如下:
+提交作业后,可以通过  [SHOW EXPORT](../../sql-manual/sql-reference/Show-Statements/SHOW-EXPORT.md) 命令查询导出作业状态。结果举例如下:
 
 ```sql
 mysql> show EXPORT\G;
@@ -187,6 +187,20 @@ FinishTime: 2019-06-25 17:08:34
 * Timeout:作业超时时间。单位是秒。该时间从 CreateTime 开始计算。
 * ErrorMsg:如果作业出现错误,这里会显示错误原因。
 
+<version since="dev">
+
+### 取消导出任务
+
+提交作业后,可以通过  [CANCEL EXPORT](../../sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT.md) 命令取消导出作业。取消命令举例如下:
+
+```sql
+CANCEL EXPORT
+FROM example_db
+WHERE LABEL like "%example%";
+````
+
+</version>
+
 ## 最佳实践
 
 ### 查询计划的拆分
@@ -216,6 +230,7 @@ FinishTime: 2019-06-25 17:08:34
 * `export_running_job_num_limit`:正在运行的 Export 作业数量限制。如果超过,则作业将等待并处于 PENDING 状态。默认为 5,可以运行时调整。
 * `export_task_default_timeout_second`:Export 作业默认超时时间。默认为 2 小时。可以运行时调整。
 * `export_tablet_num_per_task`:一个查询计划负责的最大分片数。默认为 5。
+* `label`:用户手动指定的 EXPORT 任务 label ,如果不指定会自动生成一个 label 。
 
 ## 更多帮助
 
diff --git a/docs/zh-CN/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT.md b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT.md
new file mode 100644
index 0000000000..86e8363321
--- /dev/null
+++ b/docs/zh-CN/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Manipulation/CANCEL-EXPORT.md
@@ -0,0 +1,80 @@
+---
+{
+    "title": "CANCEL-EXPORT",
+    "language": "zh-CN"
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+## CANCEL-EXPORT
+
+### Name
+
+<version since="dev">
+
+CANCEL EXPORT
+
+</version>
+
+### Description
+
+该语句用于撤销指定 label 的 EXPORT 作业,或者通过模糊匹配批量撤销 EXPORT 作业
+
+```sql
+CANCEL EXPORT
+[FROM db_name]
+WHERE [LABEL = "export_label" | LABEL like "label_pattern" | STATE = "PENDING/EXPORTING"]
+```
+
+### Example
+
+1. 撤销数据库 example_db 上, label 为 `example_db_test_export_label` 的 EXPORT 作业
+
+   ```sql
+   CANCEL EXPORT
+   FROM example_db
+   WHERE LABEL = "example_db_test_export_label";
+   ```
+
+2. 撤销数据库 example*db 上, 所有包含 example* 的 EXPORT 作业。
+
+   ```sql
+   CANCEL EXPORT
+   FROM example_db
+   WHERE LABEL like "%example%";
+   ```
+
+3. 取消状态为 PENDING 的导入作业。
+
+   ```sql
+   CANCEL EXPORT
+   FROM example_db
+   WHERE STATE = "PENDING";
+   ```
+
+### Keywords
+
+    CANCEL, EXPORT
+
+### Best Practice
+
+1. 只能取消处于 PENDING、EXPORTING 状态的未完成的导入作业。
+2. 当执行批量撤销时,Doris 不会保证所有对应的 EXPORT 作业原子的撤销。即有可能仅有部分 EXPORT 作业撤销成功。用户可以通过 SHOW EXPORT 语句查看作业状态,并尝试重复执行 CANCEL EXPORT 语句。


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org