tasks

Name

tasks

description

表函数,生成 tasks 临时表,可以查看当前 doris 集群中的 job 产生的 tasks 信息。

该函数用于 from 子句中。

该函数自 2.1.0 版本支持。

syntax

tasks("type"="insert"); 参数说明

参数名说明类型是否必填
type作业类型string

type 支持的类型:

  • insert:insert into 类型的任务。
  • mv: mv 类型的任务
Insert tasks

tasks("type"="insert");表结构:

  1. mysql> desc function tasks("type"="insert");;
  2. +---------------+------+------+-------+---------+-------+
  3. | Field | Type | Null | Key | Default | Extra |
  4. +---------------+------+------+-------+---------+-------+
  5. | TaskId | TEXT | No | false | NULL | NONE |
  6. | JobId | TEXT | No | false | NULL | NONE |
  7. | JobName | TEXT | No | false | NULL | NONE |
  8. | Label | TEXT | No | false | NULL | NONE |
  9. | Status | TEXT | No | false | NULL | NONE |
  10. | ErrorMsg | TEXT | No | false | NULL | NONE |
  11. | CreateTime | TEXT | No | false | NULL | NONE |
  12. | FinishTime | TEXT | No | false | NULL | NONE |
  13. | TrackingUrl | TEXT | No | false | NULL | NONE |
  14. | LoadStatistic | TEXT | No | false | NULL | NONE |
  15. | User | TEXT | No | false | NULL | NONE |
  16. +---------------+------+------+-------+---------+-------+
  17. 11 row in set (0.01 sec)
  • TaskId:task id
  • JobId:job id
  • JobName:job 名称
  • Label:label
  • Status:task 状态
  • ErrorMsg:task 失败信息
  • CreateTime:task 创建时间
  • FinishTime:task 结束时间
  • TrackingUrl:task tracking url
  • LoadStatistic:task 统计信息
  • User:执行用户
MV tasks
  1. mysql> desc function tasks("type"="mv");
  2. +-----------------------+------+------+-------+---------+-------+
  3. | Field | Type | Null | Key | Default | Extra |
  4. +-----------------------+------+------+-------+---------+-------+
  5. | TaskId | TEXT | No | false | NULL | NONE |
  6. | JobId | TEXT | No | false | NULL | NONE |
  7. | JobName | TEXT | No | false | NULL | NONE |
  8. | MvId | TEXT | No | false | NULL | NONE |
  9. | MvName | TEXT | No | false | NULL | NONE |
  10. | MvDatabaseId | TEXT | No | false | NULL | NONE |
  11. | MvDatabaseName | TEXT | No | false | NULL | NONE |
  12. | Status | TEXT | No | false | NULL | NONE |
  13. | ErrorMsg | TEXT | No | false | NULL | NONE |
  14. | CreateTime | TEXT | No | false | NULL | NONE |
  15. | StartTime | TEXT | No | false | NULL | NONE |
  16. | FinishTime | TEXT | No | false | NULL | NONE |
  17. | DurationMs | TEXT | No | false | NULL | NONE |
  18. | TaskContext | TEXT | No | false | NULL | NONE |
  19. | RefreshMode | TEXT | No | false | NULL | NONE |
  20. | NeedRefreshPartitions | TEXT | No | false | NULL | NONE |
  21. | CompletedPartitions | TEXT | No | false | NULL | NONE |
  22. | Progress | TEXT | No | false | NULL | NONE |
  23. +-----------------------+------+------+-------+---------+-------+
  24. 18 rows in set (0.00 sec)
  • TaskId:task id
  • JobId:job id
  • JobName:job 名称
  • MvId:物化视图 id
  • MvName:物化视图名称
  • MvDatabaseId:物化视图所属 db id
  • MvDatabaseName:物化视图所属 db 名称
  • Status:task 状态
  • ErrorMsg:task 失败信息
  • CreateTime:task 创建时间
  • StartTime:task 开始运行时间
  • FinishTime:task 结束运行时间
  • DurationMs:task 运行时间
  • TaskContext:task 运行参数
  • RefreshMode:刷新模式
  • NeedRefreshPartitions:本次 task 需要刷新的分区信息
  • CompletedPartitions:本次 task 刷新完成的分区信息
  • Progress:task 运行进度

example

Insert Tasks

  1. mysql> select * from tasks("type"="insert") limit 1 \G
  2. *************************** 1. row ***************************
  3. TaskId: 667704038678903
  4. JobId: 10069
  5. Label: 10069_667704038678903
  6. Status: FINISHED
  7. EtlInfo: \N
  8. TaskInfo: cluster:N/A; timeout(s):14400; max_filter_ratio:0.0; priority:NORMAL
  9. ErrorMsg: \N
  10. CreateTimeMs: 2023-12-08 16:46:57
  11. FinishTimeMs: 2023-12-08 16:46:57
  12. TrackingUrl:
  13. LoadStatistic: {"Unfinished backends":{},"ScannedRows":0,"TaskNumber":0,"LoadBytes":0,"All backends":{},"FileNumber":0,"FileSize":0}
  14. User: root
  15. 1 row in set (0.05 sec)

MV Tasks

  1. 查看所有物化视图的 task
  1. mysql> select * from tasks("type"="mv");
  1. 查看 jobName 为inner_mtmv_75043的所有 task
  1. mysql> select * from tasks("type"="mv") where JobName="inner_mtmv_75043";

keywords

  1. tasks, job, insert, mv, materilized view