Skip to content

Commit

Permalink
statement-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
catpineapple committed Jan 22, 2025
1 parent b9aa25e commit dd91381
Show file tree
Hide file tree
Showing 14 changed files with 1,120 additions and 924 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,49 +26,69 @@ under the License.
-->



## Description

This statement is used to undo an export job for the specified label. Or batch undo export jobs via fuzzy matching
This statement is used to undo an export job for the specified label. Or batch undo export jobs via fuzzy matching.

## Syntax

```sql
CANCEL EXPORT
CANCEL EXPORT
[FROM db_name]
WHERE [LABEL = "export_label" | LABEL like "label_pattern" | STATE = "PENDING/IN_QUEUE/EXPORTING"]
```

## Example
## Optional Parameters

- `db_name`

The name of the database to which the exported data task belongs. If omitted, the default is the current database.

- `export_label`

Each import needs to be assigned a unique Label. Stopping this task requires specifying the label.

- `label_pattern`

A label expression for fuzzy matching. If you want to undo multiple EXPORT jobs, you can use `LIKE` for fuzzy matching.

## Access Control Requirements

The user executing this SQL command must have at least the following privileges:

| Privilege | Object | Notes |
|:--------------|:----------|:----------------------------------------------|
| ALTER_PRIV | Database | Requires modification access to the database. |


1. Cancel the export job whose label is `example_db_test_export_label` on the database example_db
## Usage Notes

1. Only pending export jobs in PENDING, IN_QUEUE,EXPORTING state can be canceled.
2. When performing batch undo, Doris does not guarantee the atomic undo of all corresponding export jobs. That is, it is possible that only some of the export jobs were successfully undone. The user can view the job status through the SHOW EXPORT statement and try to execute the CANCEL EXPORT statement repeatedly.
3. When the job of the `EXPORTING` state is revoked, part of the data may have been exported to the storage system, and the user needs to process (delete) this section to export data.

## Examples

- Cancel the export job whose label is `example_db_test_export_label` on the database example_db.

```sql
CANCEL EXPORT
FROM example_db
WHERE LABEL = "example_db_test_export_label" and STATE = "EXPORTING";
```

2. Cancel all export jobs containing example* on the database example*db.
- Cancel all export jobs containing example* on the database example*db.

```sql
CANCEL EXPORT
FROM example_db
WHERE LABEL like "%example%";
```

3. Cancel all export jobs which state are "PENDING"
- Cancel all export jobs which state are "PENDING"

```sql
CANCEL EXPORT
FROM example_db
WHERE STATE = "PENDING";
```

## Keywords

CANCEL, EXPORT

## Best Practice

1. Only pending export jobs in PENDING, IN_QUEUE,EXPORTING state can be canceled.
2. When performing batch undo, Doris does not guarantee the atomic undo of all corresponding export jobs. That is, it is possible that only some of the export jobs were successfully undone. The user can view the job status through the SHOW EXPORT statement and try to execute the CANCEL EXPORT statement repeatedly.
3. When the job of the `EXPORTING` state is revoked, part of the data may have been exported to the storage system, and the user needs to process (delete) this section to export data.
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,46 @@ under the License.

## Description

For manual cleanup of historical load jobs. After cleaning, the Label can be reused.
Used to manually clean up the labels of historical import jobs. After cleaning up, the labels can be reused.
Commonly used in some automatic import tasks set by programs. When repeated execution, set the label of the imported fixed string.
Before each import task is initiated, execute the statement to clean up the label.

Syntax:
## Syntax

```sql
CLEAN LABEL [label] FROM db;
```

## Example
## Required Parameters

1. Clean label label1 from database db1
- `db_name`
label The name of the library.

```sql
CLEAN LABEL label1 FROM db1;
```
## Optional Parameters

2. Clean all labels from database db1
- `label`
The label to be cleaned. If omitted, the default is all labels in the current database.

```sql
CLEAN LABEL FROM db1;
```
## Access Control Requirements

## Keywords
The user executing this SQL command must have at least the following privileges:

CLEAN, LABEL
| Privilege | Object | Notes |
|:----------------------|:-----------|:----------------------------------------------|
| ALTER_PRIV | Database | Requires modification access to the database. |

## Best Practice

## Examples

- Clean label label1 from database db1

```sql
CLEAN LABEL label1 FROM db1;
```

- Clean all labels from database db1

```sql
CLEAN LABEL FROM db1;
```

Loading

0 comments on commit dd91381

Please sign in to comment.