From 8f58f73c5a1d8410727eeadcd20655ed7bdefe60 Mon Sep 17 00:00:00 2001 From: irenjj Date: Fri, 10 May 2024 21:05:21 +0800 Subject: [PATCH 1/2] docs: limit total rows copied in COPY TABLE FROM with LIMIT segment --- docs/nightly/en/reference/sql/copy.md | 5 +++++ docs/nightly/zh/reference/sql/copy.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/docs/nightly/en/reference/sql/copy.md b/docs/nightly/en/reference/sql/copy.md index 29b2c1ca5..d2b5cfc50 100644 --- a/docs/nightly/en/reference/sql/copy.md +++ b/docs/nightly/en/reference/sql/copy.md @@ -44,6 +44,7 @@ FROM { '/[]' } [ PATTERN = '' ] ) ] +[LIMIT NUM] ``` The command starts with the keyword `COPY`, followed by the name of the table you want to import data into. @@ -119,6 +120,10 @@ You can set the following **CONNECTION** options: | `ENABLE_VIRTUAL_HOST_STYLE` | If you use virtual hosting to address the bucket, set it to "true".| Optional | | `SESSION_TOKEN` | Your temporary credential for connecting the AWS S3 service. | Optional | +#### LIMIT + +You can use `LIMIT` to restrict maximum number of rows inserted at once. + ## COPY DATABASE Beside copying specific table to/from some path, `COPY` statement can also be used to copy whole database to/from some path. The syntax for copying databases is: diff --git a/docs/nightly/zh/reference/sql/copy.md b/docs/nightly/zh/reference/sql/copy.md index cf768771a..c08d2d6b3 100644 --- a/docs/nightly/zh/reference/sql/copy.md +++ b/docs/nightly/zh/reference/sql/copy.md @@ -39,6 +39,7 @@ FROM { '/[]' } [ PATTERN = '' ] ) ] +[LIMIT NUM] ``` 命令以 `COPY` 关键字开始,后面跟着要导入数据的表名。 @@ -69,6 +70,10 @@ COPY tbl FROM '/path/to/folder/xxx.parquet' WITH (FORMAT = 'parquet'); `COPY FROM` 同样支持从云存储上导入数据,比如 S3。详情请参考 [连接 S3](#连接-s3)。 +#### LIMIT 选项 + +可以通过 `LIMIT` 手动限制一次插入的最大行数。 + ### 连接 S3 你可以从 S3 导入/导出数据 From 17d772caa7f000d882f853f3f3886f58a8a81512 Mon Sep 17 00:00:00 2001 From: irenjj Date: Thu, 16 May 2024 21:06:15 +0800 Subject: [PATCH 2/2] fix: remove WITH MAX_INSERT_ROWS option --- docs/nightly/en/reference/sql/copy.md | 1 - docs/nightly/zh/reference/sql/copy.md | 1 - 2 files changed, 2 deletions(-) diff --git a/docs/nightly/en/reference/sql/copy.md b/docs/nightly/en/reference/sql/copy.md index d2b5cfc50..a8e7fb345 100644 --- a/docs/nightly/en/reference/sql/copy.md +++ b/docs/nightly/en/reference/sql/copy.md @@ -71,7 +71,6 @@ COPY tbl FROM '/path/to/folder/xxx.parquet' WITH (FORMAT = 'parquet'); |---|---|---| | `FORMAT` | Target file(s) format, e.g., JSON, CSV, Parquet | **Required** | | `PATTERN` | Use regex to match files. e.g., `*_today.parquet` | Optional | -| `MAX_INSERT_ROWS` | Maximum number of rows for insertion. e.g., `1000` | Optional | #### `CONNECTION` Option diff --git a/docs/nightly/zh/reference/sql/copy.md b/docs/nightly/zh/reference/sql/copy.md index c08d2d6b3..156462387 100644 --- a/docs/nightly/zh/reference/sql/copy.md +++ b/docs/nightly/zh/reference/sql/copy.md @@ -64,7 +64,6 @@ COPY tbl FROM '/path/to/folder/xxx.parquet' WITH (FORMAT = 'parquet'); |---|---|---| | `FORMAT` | 目标文件格式,例如 JSON, CSV, Parquet | **是** | | `PATTERN` | 使用正则匹配文件,例如 `*_today.parquet` | 可选 | -| `MAX_INSERT_ROWS` | 一次性插入最大行数,例如 `1000` | 可选 | #### Connection 选项