Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: limit total rows copied in COPY TABLE FROM with LIMIT segment #946

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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 link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC we have a default value here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in #3889 we disabled the default value in Limit:

Change the limit behavior to

do not limit by default


## 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
Loading