-
Notifications
You must be signed in to change notification settings - Fork 703
IMPORT INTO: update document for SHOW IMPORT
#21610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,76 @@ | ||||||||||||
--- | ||||||||||||
title: SHOW IMPORT GROUP | ||||||||||||
summary: An overview of the usage of SHOW IMPORT GROUP in TiDB. | ||||||||||||
--- | ||||||||||||
|
||||||||||||
# SHOW IMPORT | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main heading of the page is
Suggested change
Style Guide ReferencesFootnotes
|
||||||||||||
|
||||||||||||
The `SHOW IMPORT GROUP` statement is used to show the groups of IMPORT jobs created in TiDB. This statement can only show jobs created by the current user. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The sentence "This statement can only show jobs created by the current user" is not entirely accurate, as the behavior depends on user privileges. It would be clearer to explain this dependency here, consistent with the "Required privileges" section.1
Suggested change
Style Guide ReferencesFootnotes
|
||||||||||||
|
||||||||||||
## Required privileges | ||||||||||||
|
||||||||||||
- `SHOW IMPORT GROUPS`: if a user has the `SUPER` privilege, this statement shows all import groups in TiDB. Otherwise, this statement only shows groups created by the current user. | ||||||||||||
- `SHOW IMPORT GROUP <group-key>`: only the creator of an import group or users with the `SUPER` privilege can use this statement to view a specific import group. | ||||||||||||
|
||||||||||||
## Synopsis | ||||||||||||
|
||||||||||||
```ebnf+diagram | ||||||||||||
ShowImportGroupsStmt ::= | ||||||||||||
'SHOW' 'IMPORT' 'GROUPS' | ||||||||||||
ShowImportGroupStmt ::= | ||||||||||||
'SHOW' 'IMPORT' 'GROUP' GroupKey | ||||||||||||
``` | ||||||||||||
|
||||||||||||
The output fields of the `SHOW IMPORT` statement are described as follows: | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The text refers to
Suggested change
Style Guide ReferencesFootnotes
|
||||||||||||
|
||||||||||||
| Column | Description | | ||||||||||||
|------------------|-------------------------| | ||||||||||||
| Group_Key | The key of the group | | ||||||||||||
| Total_Jobs | Total number of jobs in this group | | ||||||||||||
| Pending | Number of pending jobs in this group | | ||||||||||||
| Running | Number of running jobs in this group | | ||||||||||||
| Completed | Number of completed jobs in this group | | ||||||||||||
| Failed | Number of failed jobs in this group | | ||||||||||||
| Cancelled | Number of cancelled jobs in this group | | ||||||||||||
| First_Job_Create_Time | The earliest create time of the jobs in this group | | ||||||||||||
| Last_Job_Update_Time | The latest update time of the jobs in this group | | ||||||||||||
|
||||||||||||
## Example | ||||||||||||
|
||||||||||||
```sql | ||||||||||||
SHOW IMPORT GROUPS; | ||||||||||||
``` | ||||||||||||
|
||||||||||||
``` | ||||||||||||
+--------------+------------+---------+---------+-----------+--------+-----------+----------------------------+----------------------------+ | ||||||||||||
| Group_Key | Total_Jobs | Pending | Running | Completed | Failed | Cancelled | First_Job_Create_Time | Last_Job_Update_Time | | ||||||||||||
+--------------+------------+---------+---------+-----------+--------+-----------+----------------------------+----------------------------+ | ||||||||||||
| system_group | 1 | 0 | 1 | 0 | 0 | 0 | 2025-08-07 01:36:18.479055 | 2025-08-07 01:36:18.479055 | | ||||||||||||
+--------------+------------+---------+---------+-----------+--------+-----------+----------------------------+----------------------------+ | ||||||||||||
| user_group | 1 | 1 | 0 | 0 | 0 | 0 | 2025-08-07 01:37:26.162268 | NULL | | ||||||||||||
+--------------+------------+---------+---------+-----------+--------+-----------+----------------------------+----------------------------+ | ||||||||||||
2 rows in set (0.01 sec) | ||||||||||||
``` | ||||||||||||
|
||||||||||||
```sql | ||||||||||||
SHOW IMPORT GROUP "system_group"; | ||||||||||||
``` | ||||||||||||
|
||||||||||||
``` | ||||||||||||
+--------------+------------+---------+---------+-----------+--------+-----------+----------------------------+----------------------------+ | ||||||||||||
| Group_Key | Total_Jobs | Pending | Running | Completed | Failed | Cancelled | First_Job_Create_Time | Last_Job_Update_Time | | ||||||||||||
+--------------+------------+---------+---------+-----------+--------+-----------+----------------------------+----------------------------+ | ||||||||||||
| system_group | 1 | 0 | 1 | 0 | 0 | 0 | 2025-08-07 01:36:18.479055 | 2025-08-07 01:36:18.479055 | | ||||||||||||
+--------------+------------+---------+---------+-----------+--------+-----------+----------------------------+----------------------------+ | ||||||||||||
1 row in set (0.01 sec) | ||||||||||||
``` | ||||||||||||
|
||||||||||||
## MySQL compatibility | ||||||||||||
|
||||||||||||
This statement is a TiDB extension to MySQL syntax. | ||||||||||||
|
||||||||||||
## See also | ||||||||||||
|
||||||||||||
* [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md) | ||||||||||||
* [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md) | ||||||||||||
Comment on lines
+75
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "See also" section is missing a reference to the related
Suggested change
Style Guide ReferencesFootnotes
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -39,33 +39,41 @@ The output fields of the `SHOW IMPORT` statement are described as follows: | |||||||||||||||||||||||||
| End_Time | The time when the task is ended | | ||||||||||||||||||||||||||
| Created_By | The name of the database user who creates the task | | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
| Last_Update_Time (NEW) | The total size of the data to be processed in the current step | | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The description for
Suggested change
Style Guide ReferencesFootnotes
|
||||||||||||||||||||||||||
| Cur_Step | The specific sequential processing step of this job | | ||||||||||||||||||||||||||
| Cur_Step_Processed_Size | The amount of data that has been processed within the current step | | ||||||||||||||||||||||||||
| Cur_Step_Total_Size | The total size of the data to be processed in the current step | | ||||||||||||||||||||||||||
| Cur_Step_Progress_Pct | The estimated completion percentage of the current step | | ||||||||||||||||||||||||||
| Cur_Step_Speed | The current data processing speed | | ||||||||||||||||||||||||||
| Cur_Step_ETA | The estimated time remaining for the current step to complete | | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
## Example | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
```sql | ||||||||||||||||||||||||||
SHOW IMPORT JOBS; | ||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+-------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+ | ||||||||||||||||||||||||||
| Job_ID | Data_Source | Target_Table | Table_ID | Phase | Status | Source_File_Size | Imported_Rows | Result_Message | Create_Time | Start_Time | End_Time | Created_By | | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+-------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+ | ||||||||||||||||||||||||||
| 1 | /path/to/file.csv | `test`.`foo` | 116 | | finished | 11GB | 950000 | | 2023-06-26 11:23:59.281257 | 2023-06-26 11:23:59.484932 | 2023-06-26 13:04:30.622952 | root@% | | ||||||||||||||||||||||||||
| 2 | /path/to/file.csv | `test`.`bar` | 130 | | finished | 1.194TB | 49995000 | | 2023-06-26 15:42:45.079237 | 2023-06-26 15:42:45.388108 | 2023-06-26 17:29:43.023568 | root@% | | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+-------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+ | ||||||||||||||||||||||||||
1 row in set (0.01 sec) | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+ | ||||||||||||||||||||||||||
| Job_ID | Data_Source | Target_Table | Table_ID | Phase | Status | Source_File_Size | Imported_Rows | Result_Message | Create_Time | Start_Time | End_Time | Created_By | Last_Update_Time | Cur_Step | Cur_Step_Processed_Size | Cur_Step_Total_Size | Cur_Step_Progress_Pct | Cur_Step_Speed | Cur_Step_ETA | | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+ | ||||||||||||||||||||||||||
| 1 | /path/to/file.csv | `test`.`foo` | 116 | | finished | 11GB | 950000 | | 2023-06-26 11:23:59.281257 | 2023-06-26 11:23:59.484932 | 2023-06-26 13:04:30.622952 | root@% | 0000-00-00 00:00:00 | NULL | NULL | NULL | NULL | NULL | NULL | | ||||||||||||||||||||||||||
| 2 | /path/to/file.csv | `test`.`bar` | 118 | global-sorting | running | 277.5GiB | 0 | | 2025-07-09 10:40:18.580706 | 2025-07-09 10:40:19.092528 | NULL | root@% | 2025-07-09 10:47:15 | encode | 4.55GB | 298GB | 1 | 10.96MB/s | 07:26:03 | +--------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+----------+----------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+----------+-------------------------+---------------------+----------- | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+ | ||||||||||||||||||||||||||
Comment on lines
+57
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The example output for
Suggested change
Style Guide ReferencesFootnotes
|
||||||||||||||||||||||||||
2 rows in set (0.01 sec) | ||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
```sql | ||||||||||||||||||||||||||
SHOW IMPORT JOB 60001; | ||||||||||||||||||||||||||
SHOW IMPORT JOB 2; | ||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||
+--------+--------------------+--------------+----------+-------+---------+------------------+---------------+----------------+----------------------------+------------+----------+------------+ | ||||||||||||||||||||||||||
| Job_ID | Data_Source | Target_Table | Table_ID | Phase | Status | Source_File_Size | Imported_Rows | Result_Message | Create_Time | Start_Time | End_Time | Created_By | | ||||||||||||||||||||||||||
+--------+--------------------+--------------+----------+-------+---------+------------------+---------------+----------------+----------------------------+------------+----------+------------+ | ||||||||||||||||||||||||||
| 60001 | /path/to/small.csv | `test`.`t` | 361 | | pending | 16B | NULL | | 2023-06-08 15:59:37.047703 | NULL | NULL | root@% | | ||||||||||||||||||||||||||
+--------+--------------------+--------------+----------+-------+---------+------------------+---------------+----------------+----------------------------+------------+----------+------------+ | ||||||||||||||||||||||||||
1 row in set (0.01 sec) | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+ | ||||||||||||||||||||||||||
| Job_ID | Data_Source | Target_Table | Table_ID | Phase | Status | Source_File_Size | Imported_Rows | Result_Message | Create_Time | Start_Time | End_Time | Created_By | Last_Update_Time | Cur_Step | Cur_Step_Processed_Size | Cur_Step_Total_Size | Cur_Step_Progress_Pct | Cur_Step_Speed | Cur_Step_ETA | | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+ | ||||||||||||||||||||||||||
| 2 | /path/to/file.csv | `test`.`bar` | 118 | global-sorting | running | 277.5GiB | 0 | | 2025-07-09 10:40:18.580706 | 2025-07-09 10:40:19.092528 | NULL | root@% | 2025-07-09 10:47:15 | encode | 4.55GB | 298GB | 1 | 10.96MB/s | 07:26:03 | +--------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+----------+----------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+----------+-------------------------+---------------------+----------- | ||||||||||||||||||||||||||
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+ | ||||||||||||||||||||||||||
Comment on lines
+71
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the previous example, the output for
Suggested change
Style Guide ReferencesFootnotes
|
||||||||||||||||||||||||||
1 row in set (0.07 sec) | ||||||||||||||||||||||||||
``` | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
## MySQL compatibility | ||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link for
SHOW IMPORT GROUP
incorrectly points to theshow-import-job.md
page. Additionally, starting the sentence with "Besides," is a bit informal. I suggest rephrasing for better clarity and to correct the link.1Style Guide References
Footnotes
Documentation should be clear, simple, and technically accurate. ↩