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

zhongjiajie pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new a45fc5b032 [doc] Add doc for pre-sql and post-sql (#10685)
a45fc5b032 is described below

commit a45fc5b032e2bc0714dfa67e07c875184c5bf17b
Author: Stalary <[email protected]>
AuthorDate: Thu Jun 30 20:01:23 2022 +0800

    [doc] Add doc for pre-sql and post-sql (#10685)
---
 docs/docs/en/guide/task/sql.md       |  12 ++++++++++--
 docs/docs/zh/guide/task/sql.md       |  12 ++++++++++--
 docs/img/tasks/demo/pre_post_sql.png | Bin 0 -> 86619 bytes
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/docs/docs/en/guide/task/sql.md b/docs/docs/en/guide/task/sql.md
index 04c40fe36c..f1793b27dc 100644
--- a/docs/docs/en/guide/task/sql.md
+++ b/docs/docs/en/guide/task/sql.md
@@ -31,18 +31,26 @@ Refer to [DataSource](../datasource/introduction.md)
 
 ## Task Example
 
-### Create a Temporary Table in Hive and Write Data
+### Hive Table Create Example
+
+#### Create a Temporary Table in Hive and Write Data
 
 This example creates a temporary table `tmp_hello_world` in Hive and writes a 
row of data. Before creating a temporary table, we need to ensure that the 
table does not exist. So we use custom parameters to obtain the time of the day 
as the suffix of the table name every time we run, this task can run every 
different day. The format of the created table name is: 
`tmp_hello_world_{yyyyMMdd}`.
 
 ![hive-sql](../../../../img/tasks/demo/hive-sql.png)
 
-### After Running the Task Successfully, Query the Results in Hive
+#### After Running the Task Successfully, Query the Results in Hive
 
 Log in to the bigdata cluster and use 'hive' command or 'beeline' or 'JDBC' 
and other methods to connect to the 'Apache Hive' for the query. The query SQL 
is `select * from tmp_hello_world_{yyyyMMdd}`, please replace `{yyyyMMdd}` with 
the date of the running day. The following shows the query screenshot:
 
 ![hive-sql](../../../../img/tasks/demo/hive-result.png)
 
+### Use Pre-SQL and Post-SQL Example
+
+Table created in the Pre-SQL, after use in the SQL statement, cleaned in the 
Post-SQL
+
+![pre_post_sql](../../../../img/tasks/demo/pre_post_sql.png)
+
 ## Notice
 
 Pay attention to the selection of SQL type. If it is an insert operation, need 
to change to "Non-Query" type.
diff --git a/docs/docs/zh/guide/task/sql.md b/docs/docs/zh/guide/task/sql.md
index f5051d3e83..e806671902 100644
--- a/docs/docs/zh/guide/task/sql.md
+++ b/docs/docs/zh/guide/task/sql.md
@@ -31,18 +31,26 @@ SQL任务类型,用于连接数据库并执行相应SQL。
 
 ## 任务样例
 
-### 在hive中创建临时表并写入数据
+### Hive表创建示例
+
+#### 在hive中创建临时表并写入数据
 
 
该样例向hive中创建临时表`tmp_hello_world`并写入一行数据。选择SQL类型为非查询,在创建临时表之前需要确保该表不存在,所以我们使用自定义参数,在每次运行时获取当天时间作为表名后缀,这样这个任务就可以每天运行。创建的表名格式为:`tmp_hello_world_{yyyyMMdd}`。
 
 ![hive-sql](../../../../img/tasks/demo/hive-sql.png)
 
-### 运行该任务成功之后在hive中查询结果
+#### 运行该任务成功之后在hive中查询结果
 
 登录集群使用`hive`命令或使用`beeline`、`JDBC`等方式连接`apache hive`进行查询,查询SQL为`select * from 
tmp_hello_world_{yyyyMMdd}`,请将`{yyyyMMdd}`替换为运行当天的日期,查询截图如下:
 
 ![hive-sql](../../../../img/tasks/demo/hive-result.png)
 
+### 使用前置sql和后置sql示例
+
+在前置sql中执行建表操作,在sql语句中执行操作,在后置sql中执行清理操作
+
+![pre_post_sql](../../../../img/tasks/demo/pre_post_sql.png)
+
 ## 注意事项
 
 * 注意SQL类型的选择,如果是INSERT等操作需要选择非查询类型。 
diff --git a/docs/img/tasks/demo/pre_post_sql.png 
b/docs/img/tasks/demo/pre_post_sql.png
new file mode 100644
index 0000000000..b19bb1c937
Binary files /dev/null and b/docs/img/tasks/demo/pre_post_sql.png differ

Reply via email to