put_rows
async
¶
put_rows(
table_arn: TableARN,
payload: bytes,
payload_format: PayloadFormat,
*,
config_overrides: Optional[AsyncS3TablesClientConfig] = None,
channel_id: Optional[ChannelId] = None,
checksum_algorithm: Optional[ChecksumAlgorithm] = None,
) -> PutRowsResponse
The PutRows operation writes rows to a channel of a table in Amazon S3 Tables, so that you can stream data into the table.
The following limits apply to each request:
-
The maximum payload size is 50 MiB (52,428,800 bytes). If the payload is larger, the request fails with a
BadRequestExceptionerror. -
The maximum number of rows in a payload is 500,000. If the payload contains more rows, the request fails with a
BadRequestExceptionerror. -
Only the
defaultchannel is supported. If you specify any otherchannelId, the request fails with aBadRequestExceptionerror.
You can gzip-compress the request body and set Content-Encoding: gzip. The 50 MiB limit applies to the request body and, if the body is compressed, also to the decompressed body. The data decoded from the payload is also limited to 50 MiB.
To send Avro, set payloadFormat to AVRO. The payload of each request must be a single Apache Avro Object Container File (OCF) with at least one row. To write more files, send a separate request for each one. Each field of the writer schema must match a column of the table. The row limit counts the rows in the file.
- Permissions
-
To use this operation, you must have all of the following permissions on the table. Amazon S3 Tables doesn't have a separate
s3tables:PutRowspermission.-
s3tables:GetTableData -
s3tables:PutTableData -
s3tables:GetTableMetadataLocation -
s3tables:UpdateTableMetadataLocation
-
Parameters:
-
table_arn(TableARN) –The Amazon Resource Name (ARN) of the table to write rows to.
-
channel_id(Optional[ChannelId], default:None) –The identifier of the channel to write rows to. If you don't specify a channel, the operation uses
default. Onlydefaultis supported. -
payload(bytes) –The rows to write, encoded in the format that you specify in
payloadFormat. The maximum payload size is 50 MiB (52,428,800 bytes), and the maximum number of rows is 500,000. -
payload_format(PayloadFormat) –Specifies the format of the rows in
payload. The following values are valid:-
JSON– Newline-delimited JSON: each row is one JSON object on its own line. -
AVRO– Apache Avro data in the Object Container File (OCF) format. Other Avro encodings, such as single-object encoding or Avro data without the container, aren't accepted. Each field of the writer schema must match a column of the table.
-
-
checksum_algorithm(Optional[ChecksumAlgorithm], default:None) –(Optional) The algorithm to use to calculate the checksum of the payload. Each
PutRowsrequest must include a payload checksum. If you use an AWS SDK, the SDK calculates the checksum for you. If the checksum doesn't match the payload, the request fails with aBadRequestExceptionerror.
Raises:
-
AccessDeniedException–The action cannot be performed because you do not have the required permission.
-
BadRequestException–The request is invalid or malformed.
-
InternalServerErrorException–The request failed due to an internal server error.
-
NotFoundException–The request was rejected because the specified resource could not be found.
-
ServiceUnavailableException–The request failed because the service is temporarily unavailable. Retry your request.
-
TooManyRequestsException–The limit on the number of requests per second was exceeded.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_s3tables/_services/async_s3_tables.py
3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 | |