Skip to main content

SHOW EXPORT

Description​

This statement is used to display the execution status of a specified export job.

Syntax​

SHOW EXPORT
[ FROM <db_name> ]
[
WHERE
[ ID = <job_id> ]
[ STATE = { "PENDING" | "EXPORTING" | "FINISHED" | "CANCELLED" } ]
[ LABEL = <label> ]
]
[ ORDER BY <column_name> [ ASC | DESC ] [, column_name [ ASC | DESC ] ... ] ]
[ LIMIT <limit> ];

Optional Parameters​

1. <db_name>: Optional parameter. If not specified, the current default database will be used.

2. <job_id>: Optional parameter. Used to specify the export job ID to display.

3. <label>: Optional parameter. Used to specify the label of the export job to display.

4. <column_name>: Optional parameter. Used to specify the column name for sorting.

5. <limit>: Optional parameter. If specified, only the specified number of matching records will be displayed; if not specified, all records will be displayed.

Return Value​

ColumnDataTypeNote
JobIdstringUnique ID of the job
LabelstringThe label of the export job. If not specified, the system will generate one by default.
StatestringJob status:
- PENDING: Job waiting for scheduling
- EXPORTING: Data exporting
- FINISHED: Job successful
- CANCELLED: Job failed
ProgressstringJob progress. This progress is measured in query plan units. For example, if there are 10 threads and 3 are completed, the progress is 30%.
TaskInfojsonJob information displayed in JSON format:
- db: Database name
- tbl: Table name
- partitions: Specified partitions for export, empty list means all partitions
- column_separator: Column delimiter for the exported file
- line_delimiter: Line delimiter for the exported file
- tablet num: Total number of involved tablets
- broker: Name of the broker used
- coord num: Number of query plans
- max_file_size: Maximum size of an exported file
- delete_existing_files: Whether to delete existing files and directories in the export directory
- columns: Columns to export, empty value means export all columns
- format: File format of the export
PathstringExport path on remote storage
CreateTimestringJob creation time
StartTimestringJob start time
FinishTimestringJob finish time
TimeoutintJob timeout (in seconds). The time is calculated from CreateTime.
ErrorMsgstringIf the job encounters an error, the error reason will be displayed here.
OutfileInfostringIf the export job is successful, the specific SELECT INTO OUTFILE result information will be displayed here.

Access Control Requirements​

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

PrivilegeObjectNotes
SELECT_PRIVDatabase (Database)Requires read access to the database and table.

Examples​

  • Display all export jobs for the default db

    SHOW EXPORT;
  • Display export jobs for a specified db, ordered by StartTime in descending order

     SHOW EXPORT FROM example_db ORDER BY StartTime DESC;
  • Display export jobs for a specified db where the state is "exporting", ordered by StartTime in descending order

    SHOW EXPORT FROM example_db WHERE STATE = "exporting" ORDER BY StartTime DESC;
  • Display export job for a specified db and job_id

      SHOW EXPORT FROM example_db WHERE ID = job_id;
  • Display export job for a specified db and label

     SHOW EXPORT FROM example_db WHERE LABEL = "mylabel";