SHOW JOB / JOBS command¶
The SHOW JOBS command returns information about all the unexpired jobs in the current service group.
The system periodically cleans up succeeded or failed jobs at a default interval of 7 days. Unexpired jobs refer to the jobs that are not cleaned up by the system.
The following table describes the information returned by the SHOW JOBS command:
| Column | Description |
|---|---|
job_id |
The ID of the job. |
type |
The job type. The job type can be: COMPACT: Compacts the data. STATS: Generates statistics. FLUSH: Flushes the data. REPAIR_INDEX: An internal background index build job that is created automatically during index creation. |
state |
The status of a specific job. The job status can be: SUBMITTED: The job is queuing and awaiting execution. RUNNING: The job is currently in progress. SUCCEEDED:The job is successfully SUCCEEDED. FAILED: The job fails. STOPPED: The job stops. |
submit_time |
The timestamp indicating the time when the job reaches the SUBMITTED status. |
start_time |
The timestamp indicating the time when the job reaches the RUNNING status. |
end_time |
The timestamp indicating the time when the job reaches the SUCCEEDED, FAILED, or STOPPED status. |
To view details about a specific job, use the SHOW JOB <job_id> command. The job_id can come from a manually submitted job or from SHOW JOBS when you inspect a background job.
The following table describes the information returned by the SHOW JOB command:
| Column | Description |
|---|---|
task_id |
The ID of a task that constitutes the job. |
state |
The status of a specific task. The task status can be: TASK_DISPATCH: The task is dispatched. TASK_RUNNING: The task is running. TASK_FAILED: The task fails. TASK_CANCEL: The task is cancelled. TASK_SUCCEEDED: The task is completed. TASK_RETRY: The task is re-executed. |
service_id |
The ID of a service that executes the task. |
dispatch_time |
The timestamp indicating the time when the task reaches the TASK_DISPATCH status. |
end_time |
The timestamp indicating the time when the job reaches the SUCCEEDED, FAILED, or STOPPED status. |
Syntax¶
- show_jobs_command
- show_job_command
show_jobs_command ::=
'SHOW' 'JOBS'
show_job_command ::=
'SHOW' 'JOB' job_id
Parameters¶
job_id¶
The ID of a specific job.
Examples¶
Show all jobs¶
SHOW JOBS
Return:
+--------+--------------+-----------+-----------------------------+-----------------------------+-----------------------------+
| job_id | type | state | submit_time | start_time | end_time |
+--------+--------------+-----------+-----------------------------+-----------------------------+-----------------------------+
| 4 | REPAIR_INDEX | SUCCEEDED | 2025-03-18T10:25:22.296000Z | 2025-03-18T10:25:22.300000Z | 2025-03-18T10:25:22.371000Z |
| 3 | STATS | SUCCEEDED | 2025-03-18T10:19:42.339000Z | 2025-03-18T10:19:42.340000Z | 2025-03-18T10:19:42.351000Z |
| 2 | COMPACT | SUCCEEDED | 2025-03-18T10:19:29.554000Z | 2025-03-18T10:19:29.556000Z | 2025-03-18T10:19:29.654000Z |
| 1 | FLUSH | SUCCEEDED | 2025-03-18T10:19:24.308000Z | 2025-03-18T10:19:24.312000Z | 2025-03-18T10:19:24.430000Z |
+--------+--------------+-----------+-----------------------------+-----------------------------+-----------------------------+
Show a specific job¶
SHOW JOB 1
Return:
+---------+----------------+------------+-----------------------------+-----------------------------+
| task_id | state | service_id | dispatch_time | end_time |
+---------+----------------+------------+-----------------------------+-----------------------------+
| 1 | TASK_SUCCEEDED | 2 | 2025-03-18T07:35:44.211000Z | 2025-03-18T07:35:44.247000Z |
+---------+----------------+------------+-----------------------------+-----------------------------+