@@ -24,127 +24,87 @@ specific language governing permissions and limitations
24
24
under the License.
25
25
-->
26
26
27
- ## ` jobs `
28
-
29
- ### Name
30
-
31
- jobs
32
-
33
- ### description
27
+ ## Description
34
28
35
29
Table function, generating a temporary task table, which can view job information in a certain task type.
36
30
37
- This function is used in the from clause.
31
+ ## Syntax
38
32
39
- This function is supported since 2.1.0.
33
+ ``` sql
34
+ JOBS(
35
+ " type" = " <type>"
36
+ )
37
+ ```
40
38
41
- #### syntax
39
+ ## Required Parameters
40
+ | Field | Description |
41
+ | ---------------| -----------------------------------------------------------------------------------------------|
42
+ | ** ` <type> ` ** | The type of the job: <br /> ` insert ` : Insert into type job. <br /> ` mv ` : Materialized view job. |
42
43
43
- ` jobs("type"="") `
44
44
45
- ** parameter description**
46
45
47
- | parameter | description | type | required |
48
- | :----------| :------------| :-------| :---------|
49
- | type | job type | string | yes |
46
+ ## Return Value
50
47
51
- the ** type** supported types
52
- - insert: insert into type job
53
- - mv: materialized view job
48
+ - ** ` jobs("type"="insert") ` ** Job return value of type insert
54
49
55
- ##### insert job
56
- jobs("type"="insert")Table structure:
57
- ```
58
- mysql> desc function jobs("type"="insert");
59
- +-------------------+------+------+-------+---------+-------+
60
- | Field | Type | Null | Key | Default | Extra |
61
- +-------------------+------+------+-------+---------+-------+
62
- | Id | TEXT | No | false | NULL | NONE |
63
- | Name | TEXT | No | false | NULL | NONE |
64
- | Definer | TEXT | No | false | NULL | NONE |
65
- | ExecuteType | TEXT | No | false | NULL | NONE |
66
- | RecurringStrategy | TEXT | No | false | NULL | NONE |
67
- | Status | TEXT | No | false | NULL | NONE |
68
- | ExecuteSql | TEXT | No | false | NULL | NONE |
69
- | CreateTime | TEXT | No | false | NULL | NONE |
70
- | SucceedTaskCount | TEXT | No | false | NULL | NONE |
71
- | FailedTaskCount | TEXT | No | false | NULL | NONE |
72
- | CanceledTaskCount | TEXT | No | false | NULL | NONE |
73
- | Comment | TEXT | No | false | NULL | NONE |
74
- +-------------------+------+------+-------+---------+-------+
75
- 12 rows in set (0.01 sec)
76
- ```
77
- * Id: job ID.
78
- * Name: job name.
79
- * Definer: job definer.
80
- * ExecuteType: Execution type
81
- * RecurringStrategy: recurring strategy
82
- * Status: Job status
83
- * ExecuteSql: Execution SQL
84
- * CreateTime: Job creation time
85
- * SucceedTaskCount: Number of successful tasks
86
- * FailedTaskCount: Number of failed tasks
87
- * CanceledTaskCount: Number of canceled tasks
88
- * Comment: job comment
89
-
90
- ##### matterialized view job
91
-
92
- jobs("type"="mv")Table structure:
93
- ``` sql
94
- mysql> desc function jobs(" type" = " mv" );
95
- + -- -----------------+------+------+-------+---------+-------+
96
- | Field | Type | Null | Key | Default | Extra |
97
- + -- -----------------+------+------+-------+---------+-------+
98
- | Id | TEXT | No | false | NULL | NONE |
99
- | Name | TEXT | No | false | NULL | NONE |
100
- | MvId | TEXT | No | false | NULL | NONE |
101
- | MvName | TEXT | No | false | NULL | NONE |
102
- | MvDatabaseId | TEXT | No | false | NULL | NONE |
103
- | MvDatabaseName | TEXT | No | false | NULL | NONE |
104
- | ExecuteType | TEXT | No | false | NULL | NONE |
105
- | RecurringStrategy | TEXT | No | false | NULL | NONE |
106
- | Status | TEXT | No | false | NULL | NONE |
107
- | CreateTime | TEXT | No | false | NULL | NONE |
108
- + -- -----------------+------+------+-------+---------+-------+
109
- 10 rows in set (0 .00 sec)
110
- ```
50
+ | Field | Description |
51
+ | --------------------| ----------------------------|
52
+ | Id | Job ID |
53
+ | Name | Job name |
54
+ | Definer | Job definer |
55
+ | ExecuteType | Execution type |
56
+ | RecurringStrategy | Recurring strategy |
57
+ | Status | Job status |
58
+ | ExecuteSql | Execution SQL |
59
+ | CreateTime | Job creation time |
60
+ | SucceedTaskCount | Number of successful tasks |
61
+ | FailedTaskCount | Number of failed tasks |
62
+ | CanceledTaskCount | Number of canceled tasks |
63
+ | Comment | Job comment |
111
64
112
- * Id: job ID.
113
- * Name: job name.
114
- * MvId: Materialized View ID
115
- * MvName: Materialized View Name
116
- * MvDatabaseId: DB ID of the materialized view
117
- * MvDatabaseName: Name of the database to which the materialized view belongs
118
- * ExecuteType: Execution type
119
- * RecurringStrategy: Loop strategy
120
- * Status: Job status
121
- * CreateTime: Task creation time
122
65
123
- ### example
66
+ - ** ` jobs("type"="mv") ` ** MV type job return value
124
67
125
- 1 . View jobs in all materialized views
68
+ | Field | Description |
69
+ | ----------------------| -------------------------------------------------------------|
70
+ | Id | job ID |
71
+ | Name | job name |
72
+ | MvId | Materialized View ID |
73
+ | MvName | Materialized View Name |
74
+ | MvDatabaseId | DB ID of the materialized view |
75
+ | MvDatabaseName | Name of the database to which the materialized view belongs |
76
+ | ExecuteType | Execution type |
77
+ | RecurringStrategy | Loop strategy |
78
+ | Status | Job status |
79
+ | CreateTime | Task creation time |
126
80
127
- ``` sql
128
- mysql> select * from jobs(" type" = " mv" );
129
- ```
130
81
131
- 2 . View job with name ` inner_mtmv_75043 `
132
-
133
- ``` sql
134
- mysql> select * from jobs(" type" = " mv" ) where Name= " inner_mtmv_75043" ;
135
- ```
82
+ ## Examples
136
83
137
- 3 . View all insert jobs
84
+ View jobs in all materialized views
138
85
139
86
``` sql
140
- mysql> select * from jobs(" type" = " insert" );
87
+ select * from jobs(" type" = " mv" );
88
+ ```
89
+ ``` text
90
+ +-------+------------------+-------+--------------------------+--------------+--------------------------------------------------------+-------------+-------------------+---------+---------------------+
91
+ | Id | Name | MvId | MvName | MvDatabaseId | MvDatabaseName | ExecuteType | RecurringStrategy | Status | CreateTime |
92
+ +-------+------------------+-------+--------------------------+--------------+--------------------------------------------------------+-------------+-------------------+---------+---------------------+
93
+ | 23369 | inner_mtmv_23363 | 23363 | range_date_up_union_mv1 | 21805 | regression_test_nereids_rules_p0_mv_create_part_and_up | MANUAL | MANUAL TRIGGER | RUNNING | 2025-01-08 18:19:10 |
94
+ | 23377 | inner_mtmv_23371 | 23371 | range_date_up_union_mv2 | 21805 | regression_test_nereids_rules_p0_mv_create_part_and_up | MANUAL | MANUAL TRIGGER | RUNNING | 2025-01-08 18:19:10 |
95
+ | 21794 | inner_mtmv_21788 | 21788 | test_tablet_type_mtmv_mv | 16016 | zd | MANUAL | MANUAL TRIGGER | RUNNING | 2025-01-08 12:26:06 |
96
+ | 19508 | inner_mtmv_19494 | 19494 | mv1 | 16016 | zd | MANUAL | MANUAL TRIGGER | RUNNING | 2025-01-07 22:13:31 |
97
+ +-------+------------------+-------+--------------------------+--------------+--------------------------------------------------------+-------------+-------------------+---------+---------------------+
141
98
```
142
- 4 . View job with name ` one_insert_job `
143
99
100
+ View all insert jobs
144
101
``` sql
145
- mysql > select * from jobs(" type" = " insert" ) where Name = ' one_insert_job ' ;
102
+ select * from jobs(" type" = " insert" );
146
103
```
147
-
148
- ### keywords
149
-
150
- jobs, job, insert, mv, materialized view, schedule
104
+ ``` text
105
+ +----------------+----------------+---------+-------------+--------------------------------------------+---------+--------------------------------------------------------------+---------------------+------------------+-----------------+-------------------+---------+
106
+ | Id | Name | Definer | ExecuteType | RecurringStrategy | Status | ExecuteSql | CreateTime | SucceedTaskCount | FailedTaskCount | CanceledTaskCount | Comment |
107
+ +----------------+----------------+---------+-------------+--------------------------------------------+---------+--------------------------------------------------------------+---------------------+------------------+-----------------+-------------------+---------+
108
+ | 78533940810334 | insert_tab_job | root | RECURRING | EVERY 10 MINUTE STARTS 2025-01-17 14:42:53 | RUNNING | INSERT INTO test.insert_tab SELECT * FROM test.example_table | 2025-01-17 14:32:53 | 0 | 0 | 0 | |
109
+ +----------------+----------------+---------+-------------+--------------------------------------------+---------+--------------------------------------------------------------+---------------------+------------------+-----------------+-------------------+---------+
110
+ ```
0 commit comments