tasks

Name

TASKS - 图1tip

tasks

  • since 2.1

description

Table function, generates a temporary table of tasks, which allows you to view the information of tasks generated by jobs in the current Doris cluster.

This function is used in the FROM clause.

This functions is supported since 2.1.0.

syntax

tasks("type"="insert"); parameter description

parameterdescriptiontyperequired
typejob typestringyes

the type supported types

  • insert: insert into type job
  • mv: materilized view type job
Insert tasks

The table schema of tasks("type"="insert"); tvf:

  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 name
  • Label: label
  • Status: task status
  • ErrorMsg: task failure information
  • CreateTime: task creation time
  • FinishTime: task completion time
  • TrackingUrl: tracking URL
  • LoadStatistic: load statistics
  • User: 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 Name
  • MvId: Materialized View ID
  • MvName: Materialized View Name
  • MvDatabaseId: DB ID of the materialized view
  • MvDatabaseName: Name of the database to which the materialized view belongs
  • Status: task status
  • ErrorMsg: Task failure information
  • CreateTime: Task creation time
  • StartTime: Task start running time
  • FinishTime: Task End Run Time
  • DurationMs: Task runtime
  • TaskContext: Task running parameters
  • RefreshMode: refresh mode
  • NeedRefreshPartitions: The partition information that needs to be refreshed for this task
  • CompletedPartitions: The partition information that has been refreshed for this task
  • Progress: Task running progress

example

Insert Tasls

  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. View tasks for all materialized views
  1. mysql> select * from tasks("type"="mv");
  1. View all tasks with jobName inner_mtmv_75043
  1. mysql> select * from tasks("type"="mv") where JobName="inner_mtmv_75043";

keywords

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