-
Notifications
You must be signed in to change notification settings - Fork 716
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
Open
joechenrh
wants to merge
15
commits into
pingcap:master
Choose a base branch
from
joechenrh:show-import
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e781ad2
update document
joechenrh 978c792
docs: update SHOW IMPORT syntax
joechenrh 1c4cbd1
docs: refine SHOW IMPORT examples
joechenrh 9248b55
docs: rename import group example
joechenrh af8657a
docs: clarify SHOW IMPORT JOBS filters
joechenrh 9970993
docs: restore SHOW IMPORT JOB examples
joechenrh e3d312e
docs: address import review wording
joechenrh 8ac1977
docs: remove unfinished SHOW RAW IMPORT syntax
joechenrh 2188a5b
docs: clarify LIKE filtering in SHOW IMPORT JOBS
joechenrh 074cbb1
Apply suggestions from code review
joechenrh caac9a6
sql-statement-import-into: add GROUP_KEY example in the Example section
joechenrh 54a5a83
sql-statement-import-into: clarify GROUP_KEY is optional and does not…
joechenrh afa772d
editorial changes
qiancai 91ddadc
Merge branch 'master' into pr/21610
qiancai e7dc9fe
Update sql-statement-show-import-group.md
qiancai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
qiancai marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
joechenrh marked this conversation as resolved.
Outdated
|
||
|
|
||
| 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. | ||
|
joechenrh marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## 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: | ||
|
joechenrh marked this conversation as resolved.
Outdated
|
||
|
|
||
| | 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 | | ||
|
joechenrh marked this conversation as resolved.
Outdated
|
||
| | 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) | ||
|
joechenrh marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | | ||||||||||||||||||||||
|
joechenrh marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||
| | 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 | +--------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+----------+----------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+----------+-------------------------+---------------------+----------- | ||||||||||||||||||||||
| +--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+ | ||||||||||||||||||||||
|
joechenrh marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||
| 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 | +--------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+----------+----------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+----------+-------------------------+---------------------+----------- | ||||||||||||||||||||||
| +--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+ | ||||||||||||||||||||||
|
Contributor
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 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.