Skip to content

Support wildcard generation for CSV files stored in subdirectories #67471

@GMHDBJD

Description

@GMHDBJD

Feature Request

Is your feature request related to a problem? Please describe:
When TiDB derives a wildcard path from multiple table data files, CSV files stored under sibling subdirectories such as dir/subdir1/*.csv and dir/subdir2/*.csv cannot be represented correctly. The current generic prefix/suffix fallback builds one * across the full path, but Go's filepath.Match does not allow * to match /, so wildcard inference fails with "cannot generate a unique wildcard pattern".

Describe the feature you'd like:
Support wildcard generation for multi-file CSV inputs whose differences span directory components. For example, for files under dir/subdir1/ and dir/subdir2/, TiDB should be able to derive dir/subdir*/*.csv instead of rejecting the pattern.

Describe alternatives you've considered:
Users can avoid the issue by flattening all CSV files into one directory or by specifying exact file paths manually, but both approaches are awkward for exports that naturally shard data into subdirectories.

Teachability, Documentation, Adoption, Migration Strategy:
This improves IMPORT INTO and import SDK workflows for datasets organized by partition or shard directories. The change is backward compatible because it only makes fallback wildcard construction directory-aware while still validating that the generated pattern matches all and only the target table's files.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions