Files
doris/docs/en/sql-reference/sql-statements/Data Manipulation/SHOW EXPORT.md
Mingyu Chen fcd15edbf9 [Export] Support export job with label (#6835)
```
EXPORT TABLE xxx
...
PROPERTIES
(
    "label" = "mylabel",
    ...
);
```

And than user can use label to get the info by SHOW EXPORT stmt:
```
show export from db where label="mylabel";
```

For compatibility, if not specified, a random label will be used. And for history jobs, the label will be "export_job_id";

Not like LOAD stmt, here we specify label in `properties` because this will not cause grammatical conflicts,
and there is no need to modify the meta version of the metadata.
2021-10-15 10:18:11 +08:00

68 lines
2.1 KiB
Markdown

---
{
"title": "SHOW EXPORT",
"language": "en"
}
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
# SHOW EXPORT
## Description
This statement is used to show the execution of the specified export task
Grammar:
SHOW EXPORT
[FROM db_name]
[
WHERE
[ID = your_job_id]
[STATE = ["PENDING"|"EXPORTING"|"FINISHED"|"CANCELLED"]]
[LABEL = "your_label"]
]
[ORDER BY ...]
[LIMIT limit];
Explain:
1) If db_name is not specified, use the current default DB
2) If STATE is specified, the EXPORT state is matched
3) Any column combination can be sorted using ORDER BY
4) If LIMIT is specified, the limit bar matching record is displayed. Otherwise, all of them will be displayed.
## example
1. Show all export tasks of default DB
SHOW EXPORT;
2. Show the export tasks of the specified db, sorted in descending order by StartTime
SHOW EXPORT FROM example_db ORDER BY StartTime DESC;
3. Show the export task of the specified db, state is "exporting" and sorted in descending order by StartTime
SHOW EXPORT FROM example_db WHERE STATE = "exporting" ORDER BY StartTime DESC;
4. Show the export task of specifying dB and job_id
SHOW EXPORT FROM example_db WHERE ID = job_id;
5. Show the export task of specifying dB and label
SHOW EXPORT FROM example_db WHERE LABEL = "mylabel";
## keyword
SHOW,EXPORT