Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#15881
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
Frank945946 authored and ti-chi-bot committed Dec 27, 2023
1 parent 96c808f commit f68a212
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
8 changes: 1 addition & 7 deletions external-storage-uri.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,8 @@ gcs://external/test.csv?credentials-file=${credentials-file-path}
- `encryption-scope`:服务端的[加密范围 (Encryption Scope)](https://learn.microsoft.com/zh-cn/azure/storage/blobs/encryption-scope-manage?tabs=powershell#upload-a-blob-with-an-encryption-scope)
- `encryption-key`:服务端使用的[加密密钥 (Encryption Key)](https://learn.microsoft.com/zh-cn/azure/storage/blobs/encryption-customer-provided-keys),采用的加密算法为 AES256

以下是用于 TiDB Lightning 和 BR 的 Azure Blob Storage URI 示例,需要指定文件夹路径 `testfolder`
以下是用于 BR 的 Azure Blob Storage URI 示例,需要指定文件夹路径 `testfolder`

```shell
azure://external/testfolder?account-name=${account-name}&account-key=${account-key}
```

以下是用于 [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md) 的 Azure Blob Storage URI 示例,需要指定具体的文件名 `test.csv`

```shell
azure://external/test.csv?account-name=${account-name}&account-key=${account-key}
```
20 changes: 10 additions & 10 deletions sql-statements/sql-statement-import-into.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ summary: TiDB 数据库中 IMPORT INTO 的使用概况。

`IMPORT INTO` 语句使用 TiDB Lightning 的[物理导入模式](/tidb-lightning/tidb-lightning-physical-import-mode.md),用于将 `CSV``SQL``PARQUET` 等格式的数据导入到 TiDB 的一张空表中。

<<<<<<< HEAD
> **警告:**
>
> 目前该语句为实验特性,不建议在生产环境中使用。
`IMPORT INTO` 支持导入存储在 Amazon S3、GCS、Azure Blob Storage 和 TiDB 本地的数据文件。

- 对于存储在 S3、GCS 或 Azure Blob Storage 的数据文件,`IMPORT INTO` 支持通过[后端任务分布式框架](/tidb-distributed-execution-framework.md)运行。
=======
`IMPORT INTO` 支持导入存储在 Amazon S3、GCS 和 TiDB 本地的数据文件。

- 对于存储在 S3 或 GCS 的数据文件,`IMPORT INTO` 支持通过 [TiDB 分布式执行框架](/tidb-distributed-execution-framework.md)运行。
>>>>>>> f6694d8cd6 (Removed unsupported Azure Blob storage via import into (#15881))
- 当此框架功能开启时(即 [tidb_enable_dist_task](/system-variables.md#tidb_enable_dist_task-从-v710-版本开始引入) 为 `ON`),`IMPORT INTO` 会将一个数据导入任务拆分成多个子任务并分配到各个 TiDB 节点上运行,以提高导入效率。
- 当此框架功能关闭时,`IMPORT INTO` 仅支持在当前用户连接的 TiDB 节点上运行。
Expand Down Expand Up @@ -88,9 +94,9 @@ SET 表达式左侧只能引用 `ColumnNameOrUserVarList` 中没有的列名。

### fileLocation

用于指定数据文件的存储位置,该位置可以是 S3、GCSAzure Blob Storage URI 路径,也可以是 TiDB 本地文件路径。
用于指定数据文件的存储位置,该位置可以是 S3 或 GCS URI 路径,也可以是 TiDB 本地文件路径。

- S3、GCSAzure Blob Storage URI 路径:配置详见[外部存储服务的 URI 格式](/external-storage-uri.md)
- S3 或 GCS URI 路径:配置详见[外部存储服务的 URI 格式](/external-storage-uri.md)
- TiDB 本地文件路径:必须为绝对路径,数据文件后缀必须为 `.csv``.sql``.parquet`。确保该路径对应的文件存储在当前用户连接的 TiDB 节点上,且当前连接的用户有 `FILE` 权限。

> **注意:**
Expand Down Expand Up @@ -234,7 +240,7 @@ IMPORT INTO t(id, name, @1) FROM '/path/to/file.csv' WITH skip_rows=1;
IMPORT INTO t FROM '/path/to/file-*.csv'
```

### 从 S3、GCSAzure Blob Storage 导入数据
### 从 S3 或 GCS 导入数据

- 从 S3 导入数据

Expand All @@ -248,13 +254,7 @@ IMPORT INTO t FROM '/path/to/file-*.csv'
IMPORT INTO t FROM 'gs://import/test.csv?credentials-file=${credentials-file-path}';
```

- 从 Azure Blob Storage 导入数据

```sql
IMPORT INTO t FROM 'azure://import/test.csv?credentials-file=${credentials-file-path}';
```

关于 Amazon S3、GCS 和 Azure Blob Storage 的 URI 路径配置,详见[外部存储服务的 URI 格式](/external-storage-uri.md)。
关于 Amazon S3 或 GCS 的 URI 路径配置,详见[外部存储服务的 URI 格式](/external-storage-uri.md)。

### 通过 SetClause 语句计算列值

Expand Down
1 change: 0 additions & 1 deletion tidb-lightning/tidb-lightning-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ TiDB Lightning 支持从以下位置读取:
- 本地
- [Amazon S3](/external-storage-uri.md#amazon-s3-uri-格式)
- [Google GCS](/external-storage-uri.md#gcs-uri-格式)
- [Azure Blob Storage](/external-storage-uri.md#azure-blob-storage-uri-格式)

## TiDB Lightning 整体架构

Expand Down
4 changes: 2 additions & 2 deletions tidb-lightning/tidb-lightning-physical-import-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ summary: 了解 TiDB Lightning 的物理导入模式。

# 物理导入模式简介

物理导入模式 (Physical Import Mode) 是 TiDB Lightning 支持的一种数据导入方式。物理导入模式不经过 SQL 接口,而是直接将数据以键值对的形式插入 TiKV 节点,是一种高效、快速的导入模式。使用物理导入模式时,单个 TiDB Lightning 实例可导入的数据量为 10 TiB,理论上导入的数据量可以随着 TiDB Lightning 实例数量的增加而增加,目前已经有多个用户验证基于[并行导入](/tidb-lightning/tidb-lightning-distributed-import.md)功能可以导入的数据量达 50 TiB。
物理导入模式 (Physical Import Mode) 是 TiDB Lightning 支持的一种数据导入方式。物理导入模式不经过 SQL 接口,而是直接将数据以键值对的形式插入 TiKV 节点,是一种高效、快速的导入模式。使用物理导入模式时,单个 TiDB Lightning 实例可导入的数据量不超过 10 TiB,理论上导入的数据量可以随着 TiDB Lightning 实例数量的增加而增加,目前已经有多个用户验证基于[并行导入](/tidb-lightning/tidb-lightning-distributed-import.md)功能可以导入的数据量达 50 TiB。

使用前请务必自行阅读[必要条件及限制](/tidb-lightning/tidb-lightning-physical-import-mode.md#必要条件及限制)

Expand Down Expand Up @@ -81,7 +81,7 @@ backend = "local"

- 在导入数据的过程中,请勿在目标表进行 DDL 和 DML 操作,否则会导致导入失败或数据不一致。导入期间也不建议进行读操作,因为读取的数据可能不一致。请在导入操作完成后再进行读写操作。

- 单个 TiDB Lightning 进程导入单表不应超过 10 TB。使用并行导入时,TiDB Lightning 实例不应超过 10 个。
- 单个 TiDB Lightning 进程导入单表不应超过 10 TiB。使用并行导入时,TiDB Lightning 实例不应超过 10 个。

### 与其他组件一同使用的注意事项

Expand Down

0 comments on commit f68a212

Please sign in to comment.