DeleteRecord - Amazon SageMaker

DeleteRecord

Deletes a Record from a FeatureGroup in the OnlineStore. Feature Store supports both SoftDelete and HardDelete. For SoftDelete (default), feature columns are set to null and the record is no longer retrievable by GetRecord or BatchGetRecord. For HardDelete, the complete Record is removed from the OnlineStore. In both cases, Feature Store appends the deleted record marker to the OfflineStore. The deleted record marker is a record with the same RecordIdentifer as the original, but with is_deleted value set to True, EventTime set to the delete input EventTime, and other feature values set to null.

Note that the EventTime specified in DeleteRecord should be set later than the EventTime of the existing record in the OnlineStore for that RecordIdentifer. If it is not, the deletion does not occur:

  • For SoftDelete, the existing (not deleted) record remains in the OnlineStore, though the delete record marker is still written to the OfflineStore.

  • HardDelete returns EventTime: 400 ValidationException to indicate that the delete operation failed. No delete record marker is written to the OfflineStore.

When a record is deleted from the OnlineStore, the deleted record marker is appended to the OfflineStore. If you have the Iceberg table format enabled for your OfflineStore, you can remove all history of a record from the OfflineStore using Amazon Athena or Apache Spark. For information on how to hard delete a record from the OfflineStore with the Iceberg table format enabled, see Delete records from the offline store.

Request Syntax

DELETE /FeatureGroup/FeatureGroupName?DeletionMode=DeletionMode&EventTime=EventTime&RecordIdentifierValueAsString=RecordIdentifierValueAsString&TargetStores=TargetStores HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

DeletionMode

The name of the deletion mode for deleting the record. By default, the deletion mode is set to SoftDelete.

Valid Values: SoftDelete | HardDelete

EventTime

Timestamp indicating when the deletion event occurred. EventTime can be used to query data at a certain point in time.

Length Constraints: Maximum length of 358400.

Pattern: .*

Required: Yes

FeatureGroupName

The name or Amazon Resource Name (ARN) of the feature group to delete the record from.

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

RecordIdentifierValueAsString

The value for the RecordIdentifier that uniquely identifies the record, in string format.

Length Constraints: Maximum length of 358400.

Pattern: .*

Required: Yes

TargetStores

A list of stores from which you're deleting the record. By default, Feature Store deletes the record from all of the stores that you're using for the FeatureGroup.

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

Valid Values: OnlineStore | OfflineStore

Request Body

The request does not have a request body.

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 Errors.

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

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: