| title | CANCEL LOAD |
|---|---|
| language | en |
| description | This statement is used to cancel an import job with a specified label, or to cancel import jobs in batches through fuzzy matching. |
This statement is used to cancel an import job with a specified label, or to cancel import jobs in batches through fuzzy matching.
CANCEL LOAD
[FROM <db_name>]
WHERE [LABEL = "<load_label>" | LABEL like "<label_pattern>" | STATE = { "PENDING" | "ETL" | "LOADING" } ]1. <db_name>
The name of the database where the import job to be cancelled resides.
1. <load_label>
If
LABEL = "<load_label>"is used, it precisely matches the specified label.
2. <label_pattern>
If
LABEL LIKE "<label_pattern>"is used, it matches import tasks whose labels contain thelabel_pattern.
3. STATE = { " PENDING " | " ETL " | " LOADING " }
Specifying
PENDINGmeans cancelling jobs with theSTATE = "PENDING"status. The same applies to other statuses.
Users executing this SQL command must have at least the following permissions:
| Privilege | Object | Notes |
|---|---|---|
| LOAD_PRIV | Database | Import permissions for the database tables are required. |
- Cancelling jobs based on the
Stateis supported starting from version 1.2.0. - Only incomplete import jobs in the
PENDING,ETL, orLOADINGstates can be cancelled. - When performing batch cancellation, Doris does not guarantee that all corresponding import jobs will be cancelled atomically. That is, only some import jobs may be cancelled successfully. Users can check the job status using the
SHOW LOADstatement and try to execute theCANCEL LOADstatement again.
-
Cancel the import job with the label
example_db_test_load_labelin the databaseexample_db.CANCEL LOAD FROM example_db WHERE LABEL = "example_db_test_load_label";
-
Cancel all import jobs containing
example_in the databaseexample_db.CANCEL LOAD FROM example_db WHERE LABEL like "%example_%";
-
Cancel import jobs in the
LOADINGstate.CANCEL LOAD FROM example_db WHERE STATE = "loading";