UpdateRecord
Updates one or more feature values for an existing record in the specified feature group. Features that you do not include in the request remain unchanged. You can update up to 100 features per call.
Important
This operation requires the online store. It is available only for feature groups
that use the Standard_V2 or InMemory online store type.
The record you want to update must already exist in the online store. When you ingest a
record, the TargetStores parameter must include the OnlineStore.
You can specify OnlineStore alone, or both OnlineStore and
OfflineStore. Records written only to the OfflineStore can't be
updated.
The record must already exist. If the record does not exist or has been
soft-deleted, the operation returns a ResourceNotFound error. To create
a record, use PutRecord.
If you provide an EventTime that is older than the record's current
EventTime, the service rejects the update with a
ConflictException. If the EventTime is equal to or newer
than the current value, the service applies the update. If you omit
EventTime, the service keeps the record's existing
EventTime and applies the update.
If you specify a TtlDuration, you must also provide an
EventTime in the request. Otherwise, the operation returns a
ValidationError.
Request Syntax
POST /FeatureGroup/FeatureGroupName/Record HTTP/1.1
Content-type: application/json
{
"Features": [
{
"FeatureName": "string",
"ValueAsString": "string",
"ValueAsStringList": [ "string" ]
}
],
"RecordIdentifierValueAsString": "string",
"TargetStores": [ "string" ],
"TtlDuration": {
"Unit": "string",
"Value": number
}
}
URI Request Parameters
The request uses the following URI parameters.
- FeatureGroupName
-
The identifier for the feature group that contains the record to update. You can specify one of the following:
-
The feature group name.
-
The feature group Amazon Resource Name (ARN).
Length Constraints: Minimum length of 1. Maximum length of 150.
Pattern:
(arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:feature-group/)?([a-zA-Z0-9]([-_]*[a-zA-Z0-9]){0,63})Required: Yes
-
Request Body
The request accepts the following data in JSON format.
- Features
-
The feature values to write to the record.
Type: Array of FeatureValue objects
Array Members: Minimum number of 1 item.
Required: Yes
- RecordIdentifierValueAsString
-
The value that uniquely identifies the record in the feature group. This must match the value defined by the feature group's record identifier feature.
Type: String
Length Constraints: Maximum length of 358400.
Pattern:
.*Required: Yes
- TargetStores
-
The target stores for the record update. By default, Amazon SageMaker Feature Store updates the record in all stores associated with the
FeatureGroup. This list must include theOnlineStore, becauseUpdateRecordoperates on the online store.Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 2 items.
Valid Values:
OnlineStore | OfflineStoreRequired: No
- TtlDuration
-
The time-to-live (TTL) duration for the record. Amazon SageMaker Feature Store deletes the record when
EventTime+TtlDurationelapses. If you omit this parameter, the record's existing TTL setting remains unchanged. For information aboutHardDelete, see the DeleteRecord operation in the Amazon SageMaker API Reference.Type: TtlDuration object
Required: No
Response Syntax
HTTP/1.1 200
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
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
- ConflictException
-
The service rejected the update because the provided
EventTimeis older than the record's currentEventTime. To persist the update, retrieve the record's latestEventTimeand resubmit the request with anEventTimethat is equal to or newer than the current value.HTTP Status Code: 409
- 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: