Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sql-statements/sql-statement-import-into.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,19 @@ It specifies the storage location of the data file, which can be an Amazon S3 or
>
> If [SEM](/system-variables.md#tidb_enable_enhanced_security) is enabled in the target cluster, the `fileLocation` cannot be specified as a local file path.

In the `fileLocation` parameter, you can specify a single file, or use the `*` and `[]` wildcards to match multiple files for import. Note that the wildcard can only be used in the file name, because it does not match directories or recursively match files in subdirectories. Taking files stored on Amazon S3 as examples, you can configure the parameter as follows:
In the `fileLocation` parameter, you can specify a single file or use the `*` and `[]` wildcards to match multiple files for import. TiDB treats `?` as a literal character, not a wildcard. The `[]` wildcard is supported starting from TiDB v8.0.0.

For files in Amazon S3 or GCS, wildcards can appear in multiple fixed-depth path components. A wildcard matches characters only within one `/`-separated component and does not cross `/`. Recursive matching across an arbitrary number of directory levels, such as with `**`, is not supported. For files in TiDB local storage, the directory path must be exact, and wildcards can appear only in the file name.

Taking files stored on Amazon S3 as examples, you can configure the parameter as follows:

- Import a single file: `s3://<bucket-name>/path/to/data/foo.csv`
- Import all files in a specified path: `s3://<bucket-name>/path/to/data/*`
- Import all files with the `.csv` suffix in a specified path: `s3://<bucket-name>/path/to/data/*.csv`
- Import all files with the `foo` prefix in a specified path: `s3://<bucket-name>/path/to/data/foo*`
- Import all files with the `foo` prefix and the `.csv` suffix in a specified path: `s3://<bucket-name>/path/to/data/foo*.csv`
- Import `1.csv` and `2.csv` in a specified path: `s3://<bucket-name>/path/to/data/[12].csv`
- Import all CSV files from fixed-depth subdirectories whose names start with `data-`: `s3://<bucket-name>/path/to/data-*/*.csv`

### Format

Expand Down
20 changes: 12 additions & 8 deletions tidb-cloud/import-csv-files-serverless.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ To import the CSV files to {{{ .starter }}} or {{{ .essential }}}, take the foll

- To manually configure the mapping rules to associate your source CSV files with the target database and table, unselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].csv` format. For example: `TableName.01.csv`. You can also use wildcards to match multiple files. Only `*` and `?` wildcards are supported.
- **Source**: enter the file name pattern in the `[file_name].csv` format. For example: `TableName.01.csv`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files in **Destination Mapping**.

- `my-data?.csv`: matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data?.csv` matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data[1-4].csv` matches `my-data1.csv` through `my-data4.csv`.
- `my-data*.csv`: matches all CSV files that start with `my-data`, such as `my-data-2023.csv` and `my-data-final.csv`.

- **Target Database** and **Target Table**: select the target database and table to import the data to.
Expand Down Expand Up @@ -180,9 +181,10 @@ To import the CSV files to {{{ .starter }}} or {{{ .essential }}}, take the foll

- To manually configure the mapping rules to associate your source CSV files with the target database and table, unselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].csv` format. For example: `TableName.01.csv`. You can also use wildcards to match multiple files. Only `*` and `?` wildcards are supported.
- **Source**: enter the file name pattern in the `[file_name].csv` format. For example: `TableName.01.csv`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files in **Destination Mapping**.

- `my-data?.csv`: matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data?.csv` matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data[1-4].csv` matches `my-data1.csv` through `my-data4.csv`.
- `my-data*.csv`: matches all CSV files that start with `my-data`, such as `my-data-2023.csv` and `my-data-final.csv`.

- **Target Database** and **Target Table**: select the target database and table to import the data to.
Expand Down Expand Up @@ -231,9 +233,10 @@ To import the CSV files to {{{ .starter }}} or {{{ .essential }}}, take the foll

- To manually configure the mapping rules to associate your source CSV files with the target database and table, unselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].csv` format. For example: `TableName.01.csv`. You can also use wildcards to match multiple files. Only `*` and `?` wildcards are supported.
- **Source**: enter the file name pattern in the `[file_name].csv` format. For example: `TableName.01.csv`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files in **Destination Mapping**.

- `my-data?.csv`: matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data?.csv` matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data[1-4].csv` matches `my-data1.csv` through `my-data4.csv`.
- `my-data*.csv`: matches all CSV files that start with `my-data`, such as `my-data-2023.csv` and `my-data-final.csv`.

- **Target Database** and **Target Table**: select the target database and table to import the data to.
Expand Down Expand Up @@ -282,9 +285,10 @@ To import the CSV files to {{{ .starter }}} or {{{ .essential }}}, take the foll

- To manually configure the mapping rules to associate your source CSV files with the target database and table, unselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].csv` format. For example: `TableName.01.csv`. You can also use wildcards to match multiple files. Only `*` and `?` wildcards are supported.
- **Source**: enter the file name pattern in the `[file_name].csv` format. For example: `TableName.01.csv`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files in **Destination Mapping**.

- `my-data?.csv`: matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data?.csv` matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data[1-4].csv` matches `my-data1.csv` through `my-data4.csv`.
- `my-data*.csv`: matches all CSV files that start with `my-data`, such as `my-data-2023.csv` and `my-data-final.csv`.

- **Target Database** and **Target Table**: select the target database and table to import the data to.
Expand Down
9 changes: 6 additions & 3 deletions tidb-cloud/import-csv-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ To import the CSV files to TiDB Cloud, take the following steps:

- To manually configure the mapping rules to associate your source CSV files with the target database and table, deselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].csv` format. For example, `TableName.01.csv`. You can also use wildcards to match multiple files. TiDB Cloud only supports the `*` and `?` wildcards.
- **Source**: enter the file name pattern in the `[file_name].csv` format. For example, `TableName.01.csv`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files.

- `my-data?.csv`: matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data*.csv`: matches all CSV files that start with `my-data`, such as `my-data-2023.csv` and `my-data-final.csv`.
- `my-data[1-4].csv`: matches CSV files named `my-data1.csv` through `my-data4.csv`.

- **Target Database** and **Target Table**: enter the target database and table to import the data to.

Expand Down Expand Up @@ -188,10 +189,11 @@ To import the CSV files to TiDB Cloud, take the following steps:

- To manually configure the mapping rules to associate your source CSV files with the target database and table, deselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].csv` format. For example, `TableName.01.csv`. You can also use wildcards to match multiple files. TiDB Cloud only supports the `*` and `?` wildcards.
- **Source**: enter the file name pattern in the `[file_name].csv` format. For example, `TableName.01.csv`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files.

- `my-data?.csv`: matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data*.csv`: matches all CSV files that start with `my-data`, such as `my-data-2023.csv` and `my-data-final.csv`.
- `my-data[1-4].csv`: matches CSV files named `my-data1.csv` through `my-data4.csv`.

- **Target Database** and **Target Table**: enter the target database and table to import the data to.

Expand Down Expand Up @@ -261,10 +263,11 @@ To import the CSV files to TiDB Cloud, take the following steps:

- To manually configure the mapping rules to associate your source CSV files with the target database and table, deselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].csv` format. For example, `TableName.01.csv`. You can also use wildcards to match multiple files. TiDB Cloud only supports the `*` and `?` wildcards.
- **Source**: enter the file name pattern in the `[file_name].csv` format. For example, `TableName.01.csv`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files.

- `my-data?.csv`: matches all CSV files that start with `my-data` followed by a single character, such as `my-data1.csv` and `my-data2.csv`.
- `my-data*.csv`: matches all CSV files that start with `my-data`, such as `my-data-2023.csv` and `my-data-final.csv`.
- `my-data[1-4].csv`: matches CSV files named `my-data1.csv` through `my-data4.csv`.

- **Target Database** and **Target Table**: enter the target database and table to import the data to.

Expand Down
20 changes: 12 additions & 8 deletions tidb-cloud/import-parquet-files-serverless.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ To import the Parquet files to {{{ .starter }}} or {{{ .essential }}}, take the

- To manually configure the mapping rules to associate your source Parquet files with the target database and table, unselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].parquet` format. For example: `TableName.01.parquet`. You can also use wildcards to match multiple files. Only `*` and `?` wildcards are supported.
- **Source**: enter the file name pattern in the `[file_name].parquet` format. For example: `TableName.01.parquet`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files in **Destination Mapping**.

- `my-data?.parquet`: matches all Parquet files that start with `my-data` followed by a single character, such as `my-data1.parquet` and `my-data2.parquet`.
- `my-data?.parquet` matches all Parquet files that start with `my-data` followed by a single character, such as `my-data1.parquet` and `my-data2.parquet`.
- `my-data[1-4].parquet` matches `my-data1.parquet` through `my-data4.parquet`.
- `my-data*.parquet`: matches all Parquet files that start with `my-data`, such as `my-data-2023.parquet` and `my-data-final.parquet`.

- **Target Database** and **Target Table**: select the target database and table to import the data to.
Expand Down Expand Up @@ -185,9 +186,10 @@ To import the Parquet files to {{{ .starter }}} or {{{ .essential }}}, take the

- To manually configure the mapping rules to associate your source Parquet files with the target database and table, unselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].parquet` format. For example: `TableName.01.parquet`. You can also use wildcards to match multiple files. Only `*` and `?` wildcards are supported.
- **Source**: enter the file name pattern in the `[file_name].parquet` format. For example: `TableName.01.parquet`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files in **Destination Mapping**.

- `my-data?.parquet`: matches all Parquet files that start with `my-data` followed by a single character, such as `my-data1.parquet` and `my-data2.parquet`.
- `my-data?.parquet` matches all Parquet files that start with `my-data` followed by a single character, such as `my-data1.parquet` and `my-data2.parquet`.
- `my-data[1-4].parquet` matches `my-data1.parquet` through `my-data4.parquet`.
- `my-data*.parquet`: matches all Parquet files that start with `my-data`, such as `my-data-2023.parquet` and `my-data-final.parquet`.

- **Target Database** and **Target Table**: select the target database and table to import the data to.
Expand Down Expand Up @@ -236,9 +238,10 @@ To import the Parquet files to {{{ .starter }}} or {{{ .essential }}}, take the

- To manually configure the mapping rules to associate your source Parquet files with the target database and table, unselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].parquet` format. For example: `TableName.01.parquet`. You can also use wildcards to match multiple files. Only `*` and `?` wildcards are supported.
- **Source**: enter the file name pattern in the `[file_name].parquet` format. For example: `TableName.01.parquet`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files in **Destination Mapping**.

- `my-data?.parquet`: matches all Parquet files that start with `my-data` followed by a single character, such as `my-data1.parquet` and `my-data2.parquet`.
- `my-data?.parquet` matches all Parquet files that start with `my-data` followed by a single character, such as `my-data1.parquet` and `my-data2.parquet`.
- `my-data[1-4].parquet` matches `my-data1.parquet` through `my-data4.parquet`.
- `my-data*.parquet`: matches all Parquet files that start with `my-data`, such as `my-data-2023.parquet` and `my-data-final.parquet`.

- **Target Database** and **Target Table**: select the target database and table to import the data to.
Expand Down Expand Up @@ -287,9 +290,10 @@ To import the Parquet files to {{{ .starter }}} or {{{ .essential }}}, take the

- To manually configure the mapping rules to associate your source Parquet files with the target database and table, unselect this option, and then fill in the following fields:

- **Source**: enter the file name pattern in the `[file_name].parquet` format. For example: `TableName.01.parquet`. You can also use wildcards to match multiple files. Only `*` and `?` wildcards are supported.
- **Source**: enter the file name pattern in the `[file_name].parquet` format. For example: `TableName.01.parquet`. You can also use the `*`, `?`, and `[]` wildcards to match multiple files in **Destination Mapping**.

- `my-data?.parquet`: matches all Parquet files that start with `my-data` followed by a single character, such as `my-data1.parquet` and `my-data2.parquet`.
- `my-data?.parquet` matches all Parquet files that start with `my-data` followed by a single character, such as `my-data1.parquet` and `my-data2.parquet`.
- `my-data[1-4].parquet` matches `my-data1.parquet` through `my-data4.parquet`.
- `my-data*.parquet`: matches all Parquet files that start with `my-data`, such as `my-data-2023.parquet` and `my-data-final.parquet`.

- **Target Database** and **Target Table**: select the target database and table to import the data to.
Expand Down
Loading