PutRows
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
-
Request Syntax
POST /tables/rows?channelId=channelId&tableArn=tableARN HTTP/1.1
x-amz-payload-format: payloadFormat
x-amz-sdk-checksum-algorithm: checksumAlgorithm
payload
URI Request Parameters
The request uses the following URI parameters.
- channelId
-
The identifier of the channel to write rows to. If you don't specify a channel, the operation uses
default. Onlydefaultis supported.Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
[a-z0-9-]+ - checksumAlgorithm
-
(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.Valid Values:
CRC32 | CRC32C | CRC64NVME | SHA1 | SHA256 - 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.
Valid Values:
JSON | AVRORequired: Yes
-
- tableARN
-
The Amazon Resource Name (ARN) of the table to write rows to.
Length Constraints: Minimum length of 1. Maximum length of 2048.
Pattern:
(arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:bucket/[a-z0-9_-]{3,63}/table/[a-zA-Z0-9-_]{1,255})Required: Yes
Request Body
The request accepts the following binary data.
- payload
-
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.Required: Yes
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"acceptedRows": number
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- acceptedRows
-
The number of rows that the channel accepted.
Type: Long
Valid Range: Minimum value of 0.
Errors
- AccessDeniedException
-
The action cannot be performed because you do not have the required permission.
HTTP Status Code: 403
- BadRequestException
-
The request is invalid or malformed.
HTTP Status Code: 400
- InternalServerErrorException
-
The request failed due to an internal server error.
HTTP Status Code: 500
- NotFoundException
-
The request was rejected because the specified resource could not be found.
HTTP Status Code: 404
- ServiceUnavailableException
-
The request failed because the service is temporarily unavailable. Retry your request.
HTTP Status Code: 503
- TooManyRequestsException
-
The limit on the number of requests per second was exceeded.
HTTP Status Code: 429
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: