Skip to content

cloud: clarify IMPORT INTO wildcard path matching - #23488

Open
alastori wants to merge 1 commit into
pingcap:release-8.5from
alastori:fix/import-into-wildcard-paths
Open

cloud: clarify IMPORT INTO wildcard path matching#23488
alastori wants to merge 1 commit into
pingcap:release-8.5from
alastori:fix/import-into-wildcard-paths

Conversation

@alastori

@alastori alastori commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

What is changed, added or deleted? (Required)

This PR corrects the TiDB Cloud guidance for wildcard paths in IMPORT INTO:

  • Clarifies that wildcards can appear in multiple fixed-depth path components.
  • Explains that a wildcard matches only within one /-separated component and does not provide arbitrary-depth recursive matching.
  • Adds s3://<bucket-name>/dir/subdir*/*.csv as a fixed-depth S3 example.
  • Preserves the existing TiDB Self-Managed v8.5 restriction through platform-specific content in the shared SQL reference.

The previous Cloud wording incorrectly limited wildcards to file names. TiDB now supports component-aware patterns such as dir/subdir*/*.csv, while still requiring each wildcard to remain within one path component.

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

  • master (the latest development version)
  • v8.5 (the branch used by the current TiDB Cloud documentation)
  • v8.4
  • v8.3
  • v8.2
  • v8.1
  • v7.5
  • v7.1
  • v6.5

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

Validation

  • ./scripts/markdownlint sql-statements/sql-statement-import-into.md
  • python3 scripts/file-format-lint.py sql-statements/sql-statement-import-into.md
  • python3 scripts/check-manual-line-breaks.py sql-statements/sql-statement-import-into.md
  • Verified the platform filters retain the new wording and example for TiDB Cloud while preserving the existing TiDB Self-Managed v8.5 text.
  • Ran go test -tags=intest,deadlock ./pkg/importsdk -run 'Test(ValidatePattern|GenerateWildcardPath)$' -count=1 in the TiDB repository. The tests verify that the import SDK accepts and generates dir/subdir*/*.csv.
  • Ran a direct IMPORT INTO smoke test against a local TiDB cluster and an S3-compatible MinIO endpoint using s3://import-smoke/fixture/dir/subdir*/*.csv. The job finished with four imported rows from two matching directories. Decoy objects in a different directory, one level deeper, with a non-CSV extension, and without the final file component were all excluded.

The direct SQL smoke test validates S3 path matching in the TiDB engine. It does not claim an end-to-end test against a live TiDB Cloud cluster or the Aurora/RDS Parquet workflow.

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

Summary by CodeRabbit

  • Documentation
    • Clarified wildcard behavior for file locations in TiDB and TiDB Cloud.
    • Documented TiDB Cloud support for matching files in subdirectories at a fixed depth.
    • Added an example for selecting .csv files within subdirectories.

@ti-chi-bot

ti-chi-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2026
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b8a8a8f4-298e-4b01-b7bf-5249dffb9fa0

📥 Commits

Reviewing files that changed from the base of the PR and between b51acd5 and ba96fab.

📒 Files selected for processing (1)
  • sql-statements/sql-statement-import-into.md

📝 Walkthrough

Walkthrough

The fileLocation documentation now defines different wildcard behavior for TiDB and TiDB Cloud. It also includes a TiDB Cloud example for matching .csv files in subdirectories at a fixed depth.

Changes

fileLocation wildcard documentation

Layer / File(s) Summary
Document platform-specific wildcard behavior
sql-statements/sql-statement-import-into.md
The documentation limits TiDB wildcards to filenames. It allows TiDB Cloud wildcards across multiple path components without crossing / separators or matching arbitrary recursive depths. A fixed-depth .csv import example was added.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to ba96f

This localized documentation update clarifies wildcard path behavior and preserves platform-specific guidance; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: clarifying wildcard path matching for cloud IMPORT INTO documentation.
Description check ✅ Passed The description explains the documentation changes, affected version, references, validation steps, and scope limitations; only optional template sections are omitted.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ti-chi-bot

ti-chi-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

[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 jackysp 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.

Details 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 10, 2026
@alastori

Copy link
Copy Markdown
Collaborator Author

@GMHDBJD PTAL

@alastori
alastori force-pushed the fix/import-into-wildcard-paths branch from 6674b29 to ba96fab Compare August 14, 2026 05:17
@alastori

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@alastori
alastori marked this pull request as ready for review August 14, 2026 05:22
@ti-chi-bot ti-chi-bot Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 14, 2026
@CLAassistant

CLAassistant commented Aug 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants