View a markdown version of this page

BatchWriteRecord - Amazon SageMaker

BatchWriteRecord

Writes a batch of Records to one or more FeatureGroups. Use this API for bulk ingestion of records into the OnlineStore and OfflineStore.

You can set the ingested records to expire at a given time to live (TTL) duration after the record's event time by specifying the TtlDuration parameter. A request level TtlDuration applies to all entries that do not specify their own TtlDuration.

Request Syntax

POST /BatchWriteRecord HTTP/1.1 Content-type: application/json { "Entries": [ { "FeatureGroupName": "string", "Record": [ { "FeatureName": "string", "ValueAsString": "string", "ValueAsStringList": [ "string" ] } ], "TargetStores": [ "string" ], "TtlDuration": { "Unit": "string", "Value": number } } ], "TtlDuration": { "Unit": "string", "Value": number } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

Entries

A list of records to write. Each entry specifies the FeatureGroup, the record data, and optionally target stores and a TTL duration.

Type: Array of BatchWriteRecordEntry objects

Array Members: Minimum number of 1 item. Maximum number of 25 items.

Required: Yes

TtlDuration

Time to live duration applied to all entries in the batch that do not specify their own TtlDuration; ExpiresAt = EventTime + TtlDuration. For information on HardDelete, see the DeleteRecord API in the Amazon SageMaker API Reference guide.

Type: TtlDuration object

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "Errors": [ { "Entry": { "FeatureGroupName": "string", "Record": [ { "FeatureName": "string", "ValueAsString": "string", "ValueAsStringList": [ "string" ] } ], "TargetStores": [ "string" ], "TtlDuration": { "Unit": "string", "Value": number } }, "ErrorCode": "string", "ErrorMessage": "string" } ], "UnprocessedEntries": [ { "FeatureGroupName": "string", "Record": [ { "FeatureName": "string", "ValueAsString": "string", "ValueAsStringList": [ "string" ] } ], "TargetStores": [ "string" ], "TtlDuration": { "Unit": "string", "Value": 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.

Errors

A list of errors that occurred when writing records in the batch.

Type: Array of BatchWriteRecordError objects

Array Members: Minimum number of 0 items.

UnprocessedEntries

A list of entries that were not processed. These entries can be retried.

Type: Array of BatchWriteRecordEntry objects

Array Members: Minimum number of 0 items.

Errors

For information about the errors that are common to all actions, see Common Error Types.

AccessForbidden

You do not have permission to perform an action.

HTTP Status Code: 403

InternalFailure

An internal failure occurred. Try your request again. If the problem persists, contact AWS customer support.

HTTP Status Code: 500

ResourceNotFound

A resource that is required to perform an action was not found.

HTTP Status Code: 404

ServiceUnavailable

The service is currently unavailable.

HTTP Status Code: 503

ValidationError

There was an error validating your request.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: