put_rows
¶
put_rows(
table_arn: TableARN,
payload: bytes,
payload_format: PayloadFormat,
*,
config_overrides: Optional[S3TablesClientConfig] = 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/s3_tables.py
3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 | |