Skip to content

Commit

Permalink
docs: limit total rows copied in COPY TABLE FROM with LIMIT segment (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
irenjj authored May 17, 2024
1 parent 8c0865e commit b1f426c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/nightly/en/reference/sql/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ FROM { '<path>/[<filename>]' }
[ PATTERN = '<regex_pattern>' ]
)
]
[LIMIT NUM]
```

The command starts with the keyword `COPY`, followed by the name of the table you want to import data into.
Expand All @@ -70,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

Expand Down Expand Up @@ -119,6 +119,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:
Expand Down
6 changes: 5 additions & 1 deletion docs/nightly/zh/reference/sql/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ FROM { '<path>/[<filename>]' }
[ PATTERN = '<regex_pattern>' ]
)
]
[LIMIT NUM]
```

命令以 `COPY` 关键字开始,后面跟着要导入数据的表名。
Expand All @@ -63,12 +64,15 @@ COPY tbl FROM '/path/to/folder/xxx.parquet' WITH (FORMAT = 'parquet');
|---|---|---|
| `FORMAT` | 目标文件格式,例如 JSON, CSV, Parquet | **** |
| `PATTERN` | 使用正则匹配文件,例如 `*_today.parquet` | 可选 |
| `MAX_INSERT_ROWS` | 一次性插入最大行数,例如 `1000` | 可选 |

#### Connection 选项

`COPY FROM` 同样支持从云存储上导入数据,比如 S3。详情请参考 [连接 S3](#连接-s3)

#### LIMIT 选项

可以通过 `LIMIT` 手动限制一次插入的最大行数。

### 连接 S3

你可以从 S3 导入/导出数据
Expand Down

0 comments on commit b1f426c

Please sign in to comment.