Skip to content

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
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joechenrh
Copy link
Contributor

@joechenrh joechenrh commented Aug 15, 2025

First-time contributors' checklist

What is changed, added or deleted? (Required)

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions.

Only on master

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)

What is the related PR or file link(s)?

code PR: pingcap/tidb#62369

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Signed-off-by: Ruihao Chen <[email protected]>
Copy link

ti-chi-bot bot commented Aug 15, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign lilin90 for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 15, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @joechenrh, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the documentation for TiDB's IMPORT INTO feature. It introduces comprehensive documentation for the new SHOW IMPORT GROUP statement, which allows users to monitor the progress of grouped import jobs. Additionally, it updates existing documentation for IMPORT INTO to include a GROUP_KEY option and enriches the SHOW IMPORT JOB documentation with more detailed progress metrics.

Highlights

  • Introduced SHOW IMPORT GROUP Documentation: A new dedicated markdown file (sql-statements/sql-statement-show-import-group.md) has been added to detail the syntax, usage, required privileges, and output fields for the SHOW IMPORT GROUP and SHOW IMPORT GROUPS statements.
  • Enhanced IMPORT INTO Statement: The IMPORT INTO statement documentation (sql-statements/sql-statement-import-into.md) now includes a new GROUP_KEY option, enabling users to associate import jobs with specific groups.
  • Improved SHOW IMPORT JOB Details: The SHOW IMPORT JOB documentation (sql-statements/sql-statement-show-import-job.md) has been updated to provide more granular progress information, including Last_Update_Time, Cur_Step, Cur_Step_Processed_Size, Cur_Step_Total_Size, Cur_Step_Progress_Pct, Cur_Step_Speed, and Cur_Step_ETA.
  • Table of Contents and Privilege Updates: The TOC.md and privilege-management.md files have been updated to reflect the inclusion of the new SHOW IMPORT GROUP statement and its associated privilege requirements.
  • Cross-referencing: Relevant "See also" sections in sql-statements/sql-statement-cancel-import-job.md and the sql-statements/sql-statement-overview.md have been updated to link to the new SHOW IMPORT GROUP documentation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces documentation for the new SHOW IMPORT GROUP statement and updates related files. The changes are generally well-executed, adding a new feature to the documentation. My review focuses on improving clarity, consistency, and correctness. I've identified a few issues, including an incorrect link, some misleading descriptions, and formatting errors in code examples that should be addressed to enhance the quality of the documentation.

@@ -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 |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The description for Last_Update_Time is incorrect. It should describe a time, not a data size. Also, the (NEW) marker should be removed from the column name for the final documentation.1

Suggested change
| Last_Update_Time (NEW) | The total size of the data to be processed in the current step |
| Last_Update_Time | The time when the job was last updated |

Style Guide References

Footnotes

  1. Documentation must be technically accurate.

Comment on lines +57 to +62
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
| 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 | +--------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+----------+----------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+----------+-------------------------+---------------------+-----------
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The example output for SHOW IMPORT JOBS appears to be corrupted with extra characters at the end of some lines, which harms readability. This seems to be a copy-paste error and should be corrected.1

Suggested change
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
| 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 | +--------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+----------+----------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+----------+-------------------------+---------------------+-----------
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+----------+-------------------------+---------------------+-----------------------+----------------+------------+
| 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 |
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+----------+-------------------------+---------------------+-----------------------+----------------+------------+

Style Guide References

Footnotes

  1. Documentation should be readable.

Comment on lines +71 to +75
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
| 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 | +--------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+----------+----------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+----------+-------------------------+---------------------+-----------
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Similar to the previous example, the output for SHOW IMPORT JOB 2 is corrupted with extra characters, which makes it hard to read. This should be cleaned up.1

Suggested change
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
| 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 | +--------+-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------+----------+----------------+---------+------------------+---------------+----------------+----------------------------+----------------------------+----------+------------+---------------------+----------+-------------------------+---------------------+-----------
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+--------------+-------------------------+---------------------+-----------------------+----------------+--------------+
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+----------+-------------------------+---------------------+-----------------------+----------------+------------+
| 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 |
+--------+-------------------+--------------+----------+----------------+----------+------------------+---------------+----------------+----------------------------+----------------------------+----------------------------+------------+---------------------+----------+-------------------------+---------------------+-----------------------+----------------+------------+

Style Guide References

Footnotes

  1. Documentation should be readable.

For an import job with the `DETACHED` mode enabled, you can use [`SHOW IMPORT`](/sql-statements/sql-statement-show-import-job.md) to view its current job progress.
For an import job with the `DETACHED` mode enabled, you can use [`SHOW IMPORT JOB`](/sql-statements/sql-statement-show-import-job.md) to view its current job progress.

Besides, you can use [`SHOW IMPORT GROUP`](/sql-statements/sql-statement-show-import-job.md) to view the overall progress of the jobs in the group.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The link for SHOW IMPORT GROUP incorrectly points to the show-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.1

Suggested change
Besides, you can use [`SHOW IMPORT GROUP`](/sql-statements/sql-statement-show-import-job.md) to view the overall progress of the jobs in the group.
You can also use [`SHOW IMPORT GROUP(s)`](/sql-statements/sql-statement-show-import-group.md) to view the overall progress of jobs in the same group.

Style Guide References

Footnotes

  1. Documentation should be clear, simple, and technically accurate.

summary: An overview of the usage of SHOW IMPORT GROUP in TiDB.
---

# SHOW IMPORT

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The main heading of the page is # SHOW IMPORT, which is inconsistent with the page title SHOW IMPORT GROUP. It should be updated for clarity and consistency.1

Suggested change
# SHOW IMPORT
# SHOW IMPORT GROUP

Style Guide References

Footnotes

  1. Documentation should be clear, simple, and have logical flow.


# SHOW IMPORT

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

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
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.
The `SHOW IMPORT GROUP` statement is used to show the groups of `IMPORT` jobs created in TiDB. By default, this statement only shows groups of jobs created by the current user. To view all groups, you need the `SUPER` privilege.

Style Guide References

Footnotes

  1. Documentation should be clear, simple, and technically accurate.

'SHOW' 'IMPORT' 'GROUP' GroupKey
```

The output fields of the `SHOW IMPORT` statement are described as follows:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The text refers to SHOW IMPORT, but this section describes the output for SHOW IMPORT GROUP and SHOW IMPORT GROUPS. This should be corrected to avoid confusion and maintain consistency.1

Suggested change
The output fields of the `SHOW IMPORT` statement are described as follows:
The output fields of the `SHOW IMPORT GROUP(s)` statement are described as follows:

Style Guide References

Footnotes

  1. Use consistent terminology.

Comment on lines +75 to +76
* [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md)
* [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The "See also" section is missing a reference to the related SHOW IMPORT JOB(s) statement. Adding it would improve the completeness of the documentation for users navigating related commands.1

Suggested change
* [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md)
* [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md)
* [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md)
* [`SHOW IMPORT JOB(s)`](/sql-statements/sql-statement-show-import-job.md)
* [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md)

Style Guide References

Footnotes

  1. Documentation should be complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant