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 committed May 10, 2024
1 parent c1cff1f commit 8f58f73
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions 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 Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions 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 Down Expand Up @@ -69,6 +70,10 @@ COPY tbl FROM '/path/to/folder/xxx.parquet' WITH (FORMAT = 'parquet');

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

#### LIMIT 选项

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

### 连接 S3

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

0 comments on commit 8f58f73

Please sign in to comment.