Skip to main content
A streaming job is a job that creates an index, a materialized view, a table, a sink, or a source with connectors. You need to specify the IDs of the jobs that you want to cancel. You can use SHOW JOBS to get the IDs of the jobs that are in progress.

Syntax

CANCEL [ JOBS | JOB ] job_id [,...];

Examples

all jobs
SHOW JOBS;
------RESULT
  Id  |                     Statement                     | Progress
------+---------------------------------------------------+----------
 1010 | CREATE MATERIALIZED VIEW mv3 AS SELECT *FROM mv1  | 2.21%
 1012 | CREATE MATERIALIZED VIEW mv2 AS SELECT* FROM mv1  | 0.86%
Cancel jobs
CANCEL JOBS 1010, 1012;
------RESULT
Id
------
 1012
 1010

Hanging or long running CANCEL JOBS

If your CANCEL JOBS command takes a long time to run, it could be due to high barrier latency. This command needs to be synchronized with barriers currently. To let the cancellation take effect immediately, you can use the RECOVER command in a separate session.