This is an automated email from the ASF dual-hosted git repository. kirs 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 36eb56260d Add the version statement corresponding to the job (#544) 36eb56260d is described below commit 36eb56260d359c84647ec164982d60a5c2148e25 Author: Calvin Kirs <acm_ch...@yeah.net> AuthorDate: Mon Apr 15 11:10:41 2024 +0800 Add the version statement corresponding to the job (#544) * Add the version statement corresponding to the job Add the corresponding job reference document Remove redundant documents Combine the tvf function of mv and insert * add tips --- .../sql-functions/table-functions/job.md | 96 --------------- .../sql-functions/table-functions/jobs.md | 57 ++++++++- .../Create/CREATE-JOB.md | 4 +- .../sql-functions/table-functions/job.md | 97 --------------- .../sql-functions/table-functions/jobs.md | 54 ++++++++- .../Create/CREATE-JOB.md | 4 +- .../Create/CREATE-JOB.md | 130 --------------------- .../sql-functions/table-functions/job.md | 97 --------------- .../sql-functions/table-functions/jobs.md | 53 ++++++++- .../sql-functions/table-functions/tasks.md | 7 +- .../Create/CREATE-JOB.md | 5 +- sidebars.json | 1 - .../sql-functions/table-functions/job.md | 96 --------------- .../sql-functions/table-functions/jobs.md | 57 ++++++++- .../sql-functions/table-functions/tasks.md | 7 +- .../Create/CREATE-JOB.md | 7 +- versioned_sidebars/version-2.1-sidebars.json | 1 - 17 files changed, 233 insertions(+), 540 deletions(-) diff --git a/docs/sql-manual/sql-functions/table-functions/job.md b/docs/sql-manual/sql-functions/table-functions/job.md deleted file mode 100644 index 372c63f809..0000000000 --- a/docs/sql-manual/sql-functions/table-functions/job.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -{ - "title": "JOB", - "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. ---> - -## `job` - -### Name - -<version since="dev"> - -job - -</version> - -### description - -Table function, generates a temporary table of jobs, which allows you to view the information of jobs in the current Doris cluster. - -This function is used in the FROM clause. - -#### syntax - -**parameter description** - -| parameter | description | type | required | -|:----------|:------------|:-------|:---------| -| type | job type | string | yes | - -the **type** supported types -- insert: insert into type job - - -##### Insert Job - -The table schema of `tasks("type"="insert");` tvf: - -``` -mysql> desc function jobs("type"="insert") -+-------------------+------+------+-------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------------------+------+------+-------+---------+-------+ -| Id | TEXT | No | false | NULL | NONE | -| Name | TEXT | No | false | NULL | NONE | -| Definer | TEXT | No | false | NULL | NONE | -| ExecuteType | TEXT | No | false | NULL | NONE | -| RecurringStrategy | TEXT | No | false | NULL | NONE | -| Status | TEXT | No | false | NULL | NONE | -| ExecuteSql | TEXT | No | false | NULL | NONE | -| CreateTime | TEXT | No | false | NULL | NONE | -| Comment | TEXT | No | false | NULL | NONE | -+-------------------+------+------+-------+---------+-------+ -``` - -### example - -``` -mysql> select * from jobs("type"="insert") where Name='kris'\G -*************************** 1. row *************************** - Id: 10069 - Name: kris - Definer: root - ExecuteType: RECURRING -RecurringStrategy: EVERY 3 SECOND STARTS 2023-12-06 14:44:47 - Status: RUNNING - ExecuteSql: insert into address select * from mysqluser.orders.address where 'create_time' >= days_add(now(),-1) - CreateTime: 2023-12-06 14:44:44 - Comment: load mysql address datas -1 row in set (0.04 sec) -``` - -### keywords - - job, insert, schedule - diff --git a/docs/sql-manual/sql-functions/table-functions/jobs.md b/docs/sql-manual/sql-functions/table-functions/jobs.md index 602ef985db..9169eaeb81 100644 --- a/docs/sql-manual/sql-functions/table-functions/jobs.md +++ b/docs/sql-manual/sql-functions/table-functions/jobs.md @@ -28,8 +28,12 @@ under the License. ### Name +<version since="dev"> + jobs +</version> + ### description Table function, generating a temporary task table, which can view job information in a certain task type. @@ -40,6 +44,46 @@ This function is used in the from clause. `jobs("type"="")` +**parameter description** + +| parameter | description | type | required | +|:----------|:------------|:-------|:---------| +| type | job type | string | yes | + +the **type** supported types +- insert: insert into type job +- mv: materialized view job + +##### insert job +jobs("type"="insert")Table structure: +``` +mysql> desc function jobs("type"="insert") ++-------------------+------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------------------+------+------+-------+---------+-------+ +| Id | TEXT | No | false | NULL | NONE | +| Name | TEXT | No | false | NULL | NONE | +| Definer | TEXT | No | false | NULL | NONE | +| ExecuteType | TEXT | No | false | NULL | NONE | +| RecurringStrategy | TEXT | No | false | NULL | NONE | +| Status | TEXT | No | false | NULL | NONE | +| ExecuteSql | TEXT | No | false | NULL | NONE | +| CreateTime | TEXT | No | false | NULL | NONE | +| Comment | TEXT | No | false | NULL | NONE | ++-------------------+------+------+-------+---------+-------+ +``` +* Id: job ID. +* Name: job name. +* Definer: job definer. +* ExecuteType: Execution type +* RecurringStrategy: recurring strategy +* Status: Job status +* ExecuteSql: Execution SQL +* CreateTime: Job creation time +* Comment: job comment + +##### matterialized view job + jobs("type"="mv")Table structure: ```sql mysql> desc function jobs("type"="mv"); @@ -85,6 +129,17 @@ mysql> select * from jobs("type"="mv"); mysql> select * from jobs("type"="mv") where Name="inner_mtmv_75043"; ``` +3. View all insert jobs + +```sql +mysql> select * from jobs("type"="insert"); +``` +4. View job with name `one_insert_job` + +```sql +mysql> select * from jobs("type"="insert") where Name='one_insert_job'; +``` + ### keywords - jobs + jobs, job, insert, mv, materialized view, schedule diff --git a/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md b/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md index 9407d031b8..9058a8f1c4 100644 --- a/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md +++ b/docs/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md @@ -62,8 +62,8 @@ Currently, only users with the ADMIN role can perform this operation. #### Related Documentation -[PAUSE-JOB](../Alter/PAUSE-JOB.md),[RESUME-JOB](../Alter/RESUME-JOB.md),[DROP-JOB](../Drop/DROP-JOB.md), [TVF-JOB](../../../sql-functions/table-functions/job.md), -[TVF-TASKS](../../../sql-functions/table-functions/tasks) +[PAUSE-JOB](../Alter/PAUSE-JOB.md),[RESUME-JOB](../Alter/RESUME-JOB.md),[DROP-JOB](../Drop/DROP-JOB.md), [QUERY-JOB](../../../sql-functions/table-functions/jobs.md), +[QUERY-TASKS](../../../sql-functions/table-functions/tasks) ### Grammar diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/table-functions/job.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/table-functions/job.md deleted file mode 100644 index f121bd7683..0000000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/table-functions/job.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -{ - "title": "JOB", - "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. ---> - -## `job` - -### Name - -<version since="dev"> - -job - -</version> - -### description - -表函数,生成 job 临时表,可以查看当前 doris 集群中的 job 信息。 - -该函数用于from子句中。 - -#### syntax - -`jobs("type"="insert");` - -**参数说明** - -| 参数名 | 说明 | 类型 | 是否必填 | -|:-----|:-----|:-------|:-----| -| type | 作业类型 | string | 是 | - -type 支持的类型: - -- insert:insert into 类型的任务。 - -##### Insert Job - -`jobs("type"="insert");`表结构: - -``` -mysql> desc function jobs("type"="insert") -+-------------------+------+------+-------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------------------+------+------+-------+---------+-------+ -| Id | TEXT | No | false | NULL | NONE | -| Name | TEXT | No | false | NULL | NONE | -| Definer | TEXT | No | false | NULL | NONE | -| ExecuteType | TEXT | No | false | NULL | NONE | -| RecurringStrategy | TEXT | No | false | NULL | NONE | -| Status | TEXT | No | false | NULL | NONE | -| ExecuteSql | TEXT | No | false | NULL | NONE | -| CreateTime | TEXT | No | false | NULL | NONE | -| Comment | TEXT | No | false | NULL | NONE | -+-------------------+------+------+-------+---------+-------+ -``` - -### example - -``` -mysql> select * from jobs("type"="insert") where Name='kris'\G -*************************** 1. row *************************** - Id: 10069 - Name: kris - Definer: root - ExecuteType: RECURRING -RecurringStrategy: EVERY 3 SECOND STARTS 2023-12-06 14:44:47 - Status: RUNNING - ExecuteSql: insert into address select * from mysqluser.orders.address where 'create_time' >= days_add(now(),-1) - CreateTime: 2023-12-06 14:44:44 - Comment: load mysql address datas -1 row in set (0.04 sec) -``` - -### keywords - - job, insert \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/table-functions/jobs.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/table-functions/jobs.md index cbbe080703..b9be2cdd30 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/table-functions/jobs.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/table-functions/jobs.md @@ -28,7 +28,10 @@ under the License. ### Name +:::tip jobs +- since 2.1 +::: ### description @@ -40,6 +43,44 @@ jobs `jobs("type"="")` +**参数说明** + +| 参数名 | 说明 | 类型 | 是否必填 | +|:-----|:-----|:-------|:-----| +| type | 作业类型 | string | 是 | + +type 支持的类型: + +- insert:insert into 类型的任务。 +- mv:物化视图类型的任务。 +##### Insert 任务 +jobs("type"="insert")表结构: +``` +mysql> desc function jobs("type"="insert") ++-------------------+------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------------------+------+------+-------+---------+-------+ +| Id | TEXT | No | false | NULL | NONE | +| Name | TEXT | No | false | NULL | NONE | +| Definer | TEXT | No | false | NULL | NONE | +| ExecuteType | TEXT | No | false | NULL | NONE | +| RecurringStrategy | TEXT | No | false | NULL | NONE | +| Status | TEXT | No | false | NULL | NONE | +| ExecuteSql | TEXT | No | false | NULL | NONE | +| CreateTime | TEXT | No | false | NULL | NONE | +| Comment | TEXT | No | false | NULL | NONE | ++-------------------+------+------+-------+---------+-------+ +``` +* Id:job id. +* Name:job名称. +* Definer:job定义者. +* ExecuteType:执行类型 +* RecurringStrategy:循环策略 +* Status:job状态 +* ExecuteSql:执行SQL +* CreateTime:job 创建时间 +* Comment:job 注释 +##### 物化视图任务 jobs("type"="mv")表结构: ```sql mysql> desc function jobs("type"="mv"); @@ -79,12 +120,21 @@ mysql> desc function jobs("type"="mv"); mysql> select * from jobs("type"="mv"); ``` -2. 查看name为`inner_mtmv_75043`的job +2. 查看 name 为`inner_mtmv_75043`的 job ```sql mysql> select * from jobs("type"="mv") where Name="inner_mtmv_75043"; ``` +3. 查看所有 insert 任务 + +```sql +mysql> select * from jobs("type"="insert"); +``` +4. 查看 name 为`one_insert_job`的 job +```sql +mysql> select * from jobs("type"="insert") where Name='one_insert_job'; +``` ### keywords - jobs + jobs, job, insert, mv, materialized view, schedule diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md index b71b4eb34d..fa0ac93934 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md @@ -57,9 +57,9 @@ CANCELED 即取消状态 ,TASK持久化最终状态,即SUCCESS/FAILED,其他 - 目前仅支持 ***ADMIN*** 权限执行此操作。 -#### 相关文档 [PAUSE-JOB](../Alter/PAUSE-JOB.md),[RESUME-JOB](../Alter/RESUME-JOB.md),[DROP-JOB](../Drop/DROP-JOB.md), [TVF-JOB](../../../sql-functions/table-functions/job.md), +#### 相关文档 [暂停-JOB](../Alter/PAUSE-JOB.md),[恢复-JOB](../Alter/RESUME-JOB.md),[删除-JOB](../Drop/DROP-JOB.md), [查询-JOB](../../../sql-functions/table-functions/jobs.md), -[TVF-TASKS](../../../sql-functions/table-functions/tasks) +[查询-TASKS](../../../sql-functions/table-functions/tasks) ### 语法: diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md deleted file mode 100644 index c06d48a4d0..0000000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.0/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -{ -"title": "CREATE-JOB", -"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. ---> - -## CREATE-JOB - -### Name - -CREATE JOB - -### Description - -Doris Job 是根据既定计划运行的任务,用于在特定时间或指定时间间隔触发预定义的操作,从而帮助我们自动执行一些任务。从功能上来讲,它类似于操作系统上的 -定时任务(如:Linux 中的 cron、Windows 中的计划任务)。但 Doris 的 Job 调度可以精确到秒级。 - -Job 有两种类型:`ONE_TIME` 和 `BATCH`。其中 `ONE_TIME` 类型的 Job 会在指定的时间点触发,它主要用于一次性任务,而 `BATCH` 类型的 Job 会在指定的时间间隔内循环触发。 -主要用于周期性执行的任务。 - -目前仅支持 ***ADMIN*** 权限执行此操作。 - - 语法: - -```sql -CREATE - JOB - job_name - ON SCHEDULE schedule - [COMMENT 'string'] - DO sql_body; - -schedule: { - AT timestamp - | EVERY interval - [STARTS timestamp ] - [ENDS timestamp ] -} - -interval: - quantity { DAY | HOUR | MINUTE | - WEEK | SECOND } -``` - -一条有效的 Job 语句必须包含以下内容 - -- 关键字 CREATE JOB 加上作业名称,它在一个 db 中标识唯一事件。 -- ON SCHEDULE 子句,它指定了 Job 作业的类型和触发时间以及频率。 -- DO 子句,它指定了 Job 作业触发时需要执行的操作。 - -这是一个最简单的例子: - -```sql -CREATE JOB my_job ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO db1.tbl1 SELECT * FROM db2.tbl2; -``` - -该语句表示创建一个名为 my_job 的作业,每分钟执行一次,执行的操作是将 db2.tbl2 中的数据导入到 db1.tbl1 中。 - -SCHEDULER 语句用于定义作业的执行时间,频率以及持续时间,它可以指定一次性作业或者周期性作业。 -- AT timestamp - - 用于一次性事件,它指定事件仅在 给定的日期和时间执行一次 timestamp,该日期和时间必须包含日期和时间 - -- EVERY - - 表示定期重复操作,它指定了作业的执行频率,关键字后面要指定一个时间间隔,该时间间隔可以是天、小时、分钟、秒、周。 - - - interval - - 用于指定作业执行频率,它可以是天、小时、分钟、秒、周。例如:` 1 DAY` 表示每天执行一次,` 1 HOUR` 表示每小时执行一次,` 1 MINUTE` 表示每分钟执行一次,` 1 WEEK` 表示每周执行一次,` 1 SECOND` 表示每秒执行一次。 - - - STARTS timestamp - - 用于指定作业的开始时间,如果没有指定,则从当前时间的下一个时间点开始执行。 - - - ENDS timestamp - - 用于指定作业的结束时间,如果没有指定,则表示永久执行。 -- DO - - 用于指定作业触发时需要执行的操作,目前支持所有的 ***INSERT,UPDATE*** 操作。后续我们会支持更多的操作。 - -### Example - -创建一个一次性的 Job,它会在 2020-01-01 00:00:00 时执行一次,执行的操作是将 db2.tbl2 中的数据导入到 db1.tbl1 中。 - -```sql - -CREATE JOB my_job ON SCHEDULE AT '2020-01-01 00:00:00' DO INSERT INTO db1.tbl1 SELECT * FROM db2.tbl2; - -``` - -创建一个周期性的 Job,它会在 2020-01-01 00:00:00 时开始执行,每天执行一次,执行的操作是将 db2.tbl2 中的数据导入到 db1.tbl1 中。 - -```sql -CREATE JOB my_job ON SCHEDULE EVERY 1 DAY STARTS '2020-01-01 00:00:00' DO INSERT INTO db1.tbl1 SELECT * FROM db2.tbl2 WHERE create_time >= days_add(now(),-1); -``` - -创建一个周期性的 Job,它会在 2020-01-01 00:00:00 时开始执行,每天执行一次,执行的操作是将 db2.tbl2 中的数据导入到 db1.tbl1 中,该 Job 在 2020-01-01 00:10:00 时结束。 - -```sql -CREATE JOB my_job ON SCHEDULER EVERY 1 DAY STARTS '2020-01-01 00:00:00' ENDS '2020-01-01 00:10:00' DO INSERT INTO db1.tbl1 SELECT * FROM db2.tbl2 create_time >= days_add(now(),-1); -``` - -### Keywords - - CREATE, JOB - -### Best Practice \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/job.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/job.md deleted file mode 100644 index f121bd7683..0000000000 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/job.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -{ - "title": "JOB", - "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. ---> - -## `job` - -### Name - -<version since="dev"> - -job - -</version> - -### description - -表函数,生成 job 临时表,可以查看当前 doris 集群中的 job 信息。 - -该函数用于from子句中。 - -#### syntax - -`jobs("type"="insert");` - -**参数说明** - -| 参数名 | 说明 | 类型 | 是否必填 | -|:-----|:-----|:-------|:-----| -| type | 作业类型 | string | 是 | - -type 支持的类型: - -- insert:insert into 类型的任务。 - -##### Insert Job - -`jobs("type"="insert");`表结构: - -``` -mysql> desc function jobs("type"="insert") -+-------------------+------+------+-------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------------------+------+------+-------+---------+-------+ -| Id | TEXT | No | false | NULL | NONE | -| Name | TEXT | No | false | NULL | NONE | -| Definer | TEXT | No | false | NULL | NONE | -| ExecuteType | TEXT | No | false | NULL | NONE | -| RecurringStrategy | TEXT | No | false | NULL | NONE | -| Status | TEXT | No | false | NULL | NONE | -| ExecuteSql | TEXT | No | false | NULL | NONE | -| CreateTime | TEXT | No | false | NULL | NONE | -| Comment | TEXT | No | false | NULL | NONE | -+-------------------+------+------+-------+---------+-------+ -``` - -### example - -``` -mysql> select * from jobs("type"="insert") where Name='kris'\G -*************************** 1. row *************************** - Id: 10069 - Name: kris - Definer: root - ExecuteType: RECURRING -RecurringStrategy: EVERY 3 SECOND STARTS 2023-12-06 14:44:47 - Status: RUNNING - ExecuteSql: insert into address select * from mysqluser.orders.address where 'create_time' >= days_add(now(),-1) - CreateTime: 2023-12-06 14:44:44 - Comment: load mysql address datas -1 row in set (0.04 sec) -``` - -### keywords - - job, insert \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/jobs.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/jobs.md index cbbe080703..3282429dd5 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/jobs.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/jobs.md @@ -28,7 +28,9 @@ under the License. ### Name +<version since="2.1"> jobs +</version> ### description @@ -40,6 +42,44 @@ jobs `jobs("type"="")` +**参数说明** + +| 参数名 | 说明 | 类型 | 是否必填 | +|:-----|:-----|:-------|:-----| +| type | 作业类型 | string | 是 | + +type 支持的类型: + +- insert:insert into 类型的任务。 +- mv:物化视图类型的任务。 +##### Insert 任务 +jobs("type"="insert")表结构: +``` +mysql> desc function jobs("type"="insert") ++-------------------+------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------------------+------+------+-------+---------+-------+ +| Id | TEXT | No | false | NULL | NONE | +| Name | TEXT | No | false | NULL | NONE | +| Definer | TEXT | No | false | NULL | NONE | +| ExecuteType | TEXT | No | false | NULL | NONE | +| RecurringStrategy | TEXT | No | false | NULL | NONE | +| Status | TEXT | No | false | NULL | NONE | +| ExecuteSql | TEXT | No | false | NULL | NONE | +| CreateTime | TEXT | No | false | NULL | NONE | +| Comment | TEXT | No | false | NULL | NONE | ++-------------------+------+------+-------+---------+-------+ +``` +* Id:job id. +* Name:job名称. +* Definer:job定义者. +* ExecuteType:执行类型 +* RecurringStrategy:循环策略 +* Status:job状态 +* ExecuteSql:执行SQL +* CreateTime:job 创建时间 +* Comment:job 注释 +##### 物化视图任务 jobs("type"="mv")表结构: ```sql mysql> desc function jobs("type"="mv"); @@ -79,12 +119,21 @@ mysql> desc function jobs("type"="mv"); mysql> select * from jobs("type"="mv"); ``` -2. 查看name为`inner_mtmv_75043`的job +2. 查看 name 为`inner_mtmv_75043`的 job ```sql mysql> select * from jobs("type"="mv") where Name="inner_mtmv_75043"; ``` +3. 查看所有 insert 任务 + +```sql +mysql> select * from jobs("type"="insert"); +``` +4. 查看 name 为`one_insert_job`的 job +```sql +mysql> select * from jobs("type"="insert") where Name='one_insert_job'; +``` ### keywords - jobs + jobs, job, insert, mv, materialized view, schedule diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/tasks.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/tasks.md index ff6deac441..22c1ac6a51 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/tasks.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-functions/table-functions/tasks.md @@ -28,11 +28,10 @@ under the License. ### Name -<version since="dev"> - +:::tip tasks - -</version> +- since 2.1 +::: ### description diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md index b71b4eb34d..eb75fcb086 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md @@ -29,7 +29,10 @@ under the License. ### Name +:::tip CREATE JOB +- since 2.1 +::: ### Description @@ -57,7 +60,7 @@ CANCELED 即取消状态 ,TASK持久化最终状态,即SUCCESS/FAILED,其他 - 目前仅支持 ***ADMIN*** 权限执行此操作。 -#### 相关文档 [PAUSE-JOB](../Alter/PAUSE-JOB.md),[RESUME-JOB](../Alter/RESUME-JOB.md),[DROP-JOB](../Drop/DROP-JOB.md), [TVF-JOB](../../../sql-functions/table-functions/job.md), +#### 相关文档 [暂停 JOB](../Alter/PAUSE-JOB.md),[恢复-JOB](../Alter/RESUME-JOB.md),[删除-JOB](../Drop/DROP-JOB.md), [查询-JOB](../../../sql-functions/table-functions/jobs.md),[查询-TASK](../../../sql-functions/table-functions/tasks) [TVF-TASKS](../../../sql-functions/table-functions/tasks) diff --git a/sidebars.json b/sidebars.json index 49c9fc7a8f..c055bf8f33 100644 --- a/sidebars.json +++ b/sidebars.json @@ -841,7 +841,6 @@ "sql-manual/sql-functions/table-functions/catalogs", "sql-manual/sql-functions/table-functions/frontends_disks", "sql-manual/sql-functions/table-functions/active_queries", - "sql-manual/sql-functions/table-functions/job", "sql-manual/sql-functions/table-functions/jobs", "sql-manual/sql-functions/table-functions/mv_infos", "sql-manual/sql-functions/table-functions/tasks" diff --git a/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/job.md b/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/job.md deleted file mode 100644 index 372c63f809..0000000000 --- a/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/job.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -{ - "title": "JOB", - "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. ---> - -## `job` - -### Name - -<version since="dev"> - -job - -</version> - -### description - -Table function, generates a temporary table of jobs, which allows you to view the information of jobs in the current Doris cluster. - -This function is used in the FROM clause. - -#### syntax - -**parameter description** - -| parameter | description | type | required | -|:----------|:------------|:-------|:---------| -| type | job type | string | yes | - -the **type** supported types -- insert: insert into type job - - -##### Insert Job - -The table schema of `tasks("type"="insert");` tvf: - -``` -mysql> desc function jobs("type"="insert") -+-------------------+------+------+-------+---------+-------+ -| Field | Type | Null | Key | Default | Extra | -+-------------------+------+------+-------+---------+-------+ -| Id | TEXT | No | false | NULL | NONE | -| Name | TEXT | No | false | NULL | NONE | -| Definer | TEXT | No | false | NULL | NONE | -| ExecuteType | TEXT | No | false | NULL | NONE | -| RecurringStrategy | TEXT | No | false | NULL | NONE | -| Status | TEXT | No | false | NULL | NONE | -| ExecuteSql | TEXT | No | false | NULL | NONE | -| CreateTime | TEXT | No | false | NULL | NONE | -| Comment | TEXT | No | false | NULL | NONE | -+-------------------+------+------+-------+---------+-------+ -``` - -### example - -``` -mysql> select * from jobs("type"="insert") where Name='kris'\G -*************************** 1. row *************************** - Id: 10069 - Name: kris - Definer: root - ExecuteType: RECURRING -RecurringStrategy: EVERY 3 SECOND STARTS 2023-12-06 14:44:47 - Status: RUNNING - ExecuteSql: insert into address select * from mysqluser.orders.address where 'create_time' >= days_add(now(),-1) - CreateTime: 2023-12-06 14:44:44 - Comment: load mysql address datas -1 row in set (0.04 sec) -``` - -### keywords - - job, insert, schedule - diff --git a/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/jobs.md b/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/jobs.md index 602ef985db..959cca6501 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/jobs.md +++ b/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/jobs.md @@ -27,8 +27,10 @@ under the License. ## `jobs` ### Name - +:::tip jobs +- since 2.1 +::: ### description @@ -40,6 +42,46 @@ This function is used in the from clause. `jobs("type"="")` +**parameter description** + +| parameter | description | type | required | +|:----------|:------------|:-------|:---------| +| type | job type | string | yes | + +the **type** supported types +- insert: insert into type job +- mv: materialized view job + +##### insert job +jobs("type"="insert")Table structure: +``` +mysql> desc function jobs("type"="insert") ++-------------------+------+------+-------+---------+-------+ +| Field | Type | Null | Key | Default | Extra | ++-------------------+------+------+-------+---------+-------+ +| Id | TEXT | No | false | NULL | NONE | +| Name | TEXT | No | false | NULL | NONE | +| Definer | TEXT | No | false | NULL | NONE | +| ExecuteType | TEXT | No | false | NULL | NONE | +| RecurringStrategy | TEXT | No | false | NULL | NONE | +| Status | TEXT | No | false | NULL | NONE | +| ExecuteSql | TEXT | No | false | NULL | NONE | +| CreateTime | TEXT | No | false | NULL | NONE | +| Comment | TEXT | No | false | NULL | NONE | ++-------------------+------+------+-------+---------+-------+ +``` +* Id: job ID. +* Name: job name. +* Definer: job definer. +* ExecuteType: Execution type +* RecurringStrategy: recurring strategy +* Status: Job status +* ExecuteSql: Execution SQL +* CreateTime: Job creation time +* Comment: job comment + +##### matterialized view job + jobs("type"="mv")Table structure: ```sql mysql> desc function jobs("type"="mv"); @@ -85,6 +127,17 @@ mysql> select * from jobs("type"="mv"); mysql> select * from jobs("type"="mv") where Name="inner_mtmv_75043"; ``` +3. View all insert jobs + +```sql +mysql> select * from jobs("type"="insert"); +``` +4. View job with name `one_insert_job` + +```sql +mysql> select * from jobs("type"="insert") where Name='one_insert_job'; +``` + ### keywords - jobs + jobs, job, insert, mv, materialized view, schedule diff --git a/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/tasks.md b/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/tasks.md index 4cf497c891..ea5dba66a2 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/tasks.md +++ b/versioned_docs/version-2.1/sql-manual/sql-functions/table-functions/tasks.md @@ -28,11 +28,10 @@ under the License. ### Name -<version since="dev"> - +:::tip tasks - -</version> +- since 2.1 +::: ### description diff --git a/versioned_docs/version-2.1/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md b/versioned_docs/version-2.1/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md index 9407d031b8..d584384369 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md +++ b/versioned_docs/version-2.1/sql-manual/sql-reference/Data-Definition-Statements/Create/CREATE-JOB.md @@ -28,7 +28,10 @@ under the License. ### Name +:::tip CREATE JOB +- since 2.1 +::: ### Description @@ -62,8 +65,8 @@ Currently, only users with the ADMIN role can perform this operation. #### Related Documentation -[PAUSE-JOB](../Alter/PAUSE-JOB.md),[RESUME-JOB](../Alter/RESUME-JOB.md),[DROP-JOB](../Drop/DROP-JOB.md), [TVF-JOB](../../../sql-functions/table-functions/job.md), -[TVF-TASKS](../../../sql-functions/table-functions/tasks) +[PAUSE-JOB](../Alter/PAUSE-JOB.md),[RESUME-JOB](../Alter/RESUME-JOB.md),[DROP-JOB](../Drop/DROP-JOB.md), [QUERY-JOB](../../../sql-functions/table-functions/jobs.md), +[TVF-TASKS](../../../sql-functions/table-functions/tasks.md) ### Grammar diff --git a/versioned_sidebars/version-2.1-sidebars.json b/versioned_sidebars/version-2.1-sidebars.json index 8feadef261..bf819d33a7 100644 --- a/versioned_sidebars/version-2.1-sidebars.json +++ b/versioned_sidebars/version-2.1-sidebars.json @@ -835,7 +835,6 @@ "sql-manual/sql-functions/table-functions/catalogs", "sql-manual/sql-functions/table-functions/frontends_disks", "sql-manual/sql-functions/table-functions/active_queries", - "sql-manual/sql-functions/table-functions/job", "sql-manual/sql-functions/table-functions/jobs", "sql-manual/sql-functions/table-functions/mv_infos", "sql-manual/sql-functions/table-functions/tasks" --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org