tasks

Name

SinceVersion dev

tasks

description

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

该函数用于 from 子句中。

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. | Label | TEXT | No | false | NULL | NONE |
  8. | Status | TEXT | No | false | NULL | NONE |
  9. | EtlInfo | TEXT | No | false | NULL | NONE |
  10. | TaskInfo | TEXT | No | false | NULL | NONE |
  11. | ErrorMsg | TEXT | No | false | NULL | NONE |
  12. | CreateTimeMs | TEXT | No | false | NULL | NONE |
  13. | FinishTimeMs | TEXT | No | false | NULL | NONE |
  14. | TrackingUrl | TEXT | No | false | NULL | NONE |
  15. | LoadStatistic | TEXT | No | false | NULL | NONE |
  16. | User | TEXT | No | false | NULL | NONE |
  17. +---------------+------+------+-------+---------+-------+
  18. 12 rows in set (0.01 sec)
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