SageMakerFeatureStoreRuntime / Client / batch_write_record
batch_write_record¶
- SageMakerFeatureStoreRuntime.Client.batch_write_record(**kwargs)¶
Writes a batch of
Recordsto one or moreFeatureGroup``s. Use this API for bulk ingestion of records into the ``OnlineStoreandOfflineStore.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
TtlDurationparameter. A request levelTtlDurationapplies to all entries that do not specify their ownTtlDuration.See also: AWS API Documentation
Request Syntax
response = client.batch_write_record( Entries=[ { 'FeatureGroupName': 'string', 'Record': [ { 'FeatureName': 'string', 'ValueAsString': 'string', 'ValueAsStringList': [ 'string', ] }, ], 'TargetStores': [ 'OnlineStore'|'OfflineStore', ], 'TtlDuration': { 'Unit': 'Seconds'|'Minutes'|'Hours'|'Days'|'Weeks', 'Value': 123 } }, ], TtlDuration={ 'Unit': 'Seconds'|'Minutes'|'Hours'|'Days'|'Weeks', 'Value': 123 } )
- Parameters:
Entries (list) –
[REQUIRED]
A list of records to write. Each entry specifies the
FeatureGroup, the record data, and optionally target stores and a TTL duration.(dict) –
An entry to write as part of a
BatchWriteRecordrequest.FeatureGroupName (string) – [REQUIRED]
The name or Amazon Resource Name (ARN) of the
FeatureGroupto write the record to.Record (list) – [REQUIRED]
List of FeatureValues to be inserted. This will be a full over-write.
(dict) –
The value associated with a feature.
FeatureName (string) – [REQUIRED]
The name of a feature that a feature value corresponds to.
ValueAsString (string) –
The value in string format associated with a feature. Used when your
CollectionTypeisNone. Note that features types can beString,Integral, orFractional. This value represents all three types as a string.ValueAsStringList (list) –
The list of values in string format associated with a feature. Used when your
CollectionTypeis aList,Set, orVector. Note that features types can beString,Integral, orFractional. These values represents all three types as a string.(string) –
TargetStores (list) –
A list of stores to which you’re adding the record. By default, Feature Store adds the record to all of the stores that you’re using for the
FeatureGroup.(string) –
TtlDuration (dict) –
Time to live duration for this entry, where the record is hard deleted after the expiration time is reached;
ExpiresAt=EventTime+TtlDuration. This overrides the request levelTtlDuration.Unit (string) – [REQUIRED]
TtlDurationtime unit.Value (integer) – [REQUIRED]
TtlDurationtime value.
TtlDuration (dict) –
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.Unit (string) – [REQUIRED]
TtlDurationtime unit.Value (integer) – [REQUIRED]
TtlDurationtime value.
- Return type:
dict
- Returns:
Response Syntax
{ 'Errors': [ { 'Entry': { 'FeatureGroupName': 'string', 'Record': [ { 'FeatureName': 'string', 'ValueAsString': 'string', 'ValueAsStringList': [ 'string', ] }, ], 'TargetStores': [ 'OnlineStore'|'OfflineStore', ], 'TtlDuration': { 'Unit': 'Seconds'|'Minutes'|'Hours'|'Days'|'Weeks', 'Value': 123 } }, 'ErrorCode': 'string', 'ErrorMessage': 'string' }, ], 'UnprocessedEntries': [ { 'FeatureGroupName': 'string', 'Record': [ { 'FeatureName': 'string', 'ValueAsString': 'string', 'ValueAsStringList': [ 'string', ] }, ], 'TargetStores': [ 'OnlineStore'|'OfflineStore', ], 'TtlDuration': { 'Unit': 'Seconds'|'Minutes'|'Hours'|'Days'|'Weeks', 'Value': 123 } }, ] }
Response Structure
(dict) –
Errors (list) –
A list of errors that occurred when writing records in the batch.
(dict) –
The error that has occurred when attempting to write a record in a batch.
Entry (dict) –
The entry that failed to be written.
FeatureGroupName (string) –
The name or Amazon Resource Name (ARN) of the
FeatureGroupto write the record to.Record (list) –
List of FeatureValues to be inserted. This will be a full over-write.
(dict) –
The value associated with a feature.
FeatureName (string) –
The name of a feature that a feature value corresponds to.
ValueAsString (string) –
The value in string format associated with a feature. Used when your
CollectionTypeisNone. Note that features types can beString,Integral, orFractional. This value represents all three types as a string.ValueAsStringList (list) –
The list of values in string format associated with a feature. Used when your
CollectionTypeis aList,Set, orVector. Note that features types can beString,Integral, orFractional. These values represents all three types as a string.(string) –
TargetStores (list) –
A list of stores to which you’re adding the record. By default, Feature Store adds the record to all of the stores that you’re using for the
FeatureGroup.(string) –
TtlDuration (dict) –
Time to live duration for this entry, where the record is hard deleted after the expiration time is reached;
ExpiresAt=EventTime+TtlDuration. This overrides the request levelTtlDuration.Unit (string) –
TtlDurationtime unit.Value (integer) –
TtlDurationtime value.
ErrorCode (string) –
The error code for the failed record write.
ErrorMessage (string) –
The error message for the failed record write.
UnprocessedEntries (list) –
A list of entries that were not processed. These entries can be retried.
(dict) –
An entry to write as part of a
BatchWriteRecordrequest.FeatureGroupName (string) –
The name or Amazon Resource Name (ARN) of the
FeatureGroupto write the record to.Record (list) –
List of FeatureValues to be inserted. This will be a full over-write.
(dict) –
The value associated with a feature.
FeatureName (string) –
The name of a feature that a feature value corresponds to.
ValueAsString (string) –
The value in string format associated with a feature. Used when your
CollectionTypeisNone. Note that features types can beString,Integral, orFractional. This value represents all three types as a string.ValueAsStringList (list) –
The list of values in string format associated with a feature. Used when your
CollectionTypeis aList,Set, orVector. Note that features types can beString,Integral, orFractional. These values represents all three types as a string.(string) –
TargetStores (list) –
A list of stores to which you’re adding the record. By default, Feature Store adds the record to all of the stores that you’re using for the
FeatureGroup.(string) –
TtlDuration (dict) –
Time to live duration for this entry, where the record is hard deleted after the expiration time is reached;
ExpiresAt=EventTime+TtlDuration. This overrides the request levelTtlDuration.Unit (string) –
TtlDurationtime unit.Value (integer) –
TtlDurationtime value.
Exceptions
SageMakerFeatureStoreRuntime.Client.exceptions.ValidationErrorSageMakerFeatureStoreRuntime.Client.exceptions.ResourceNotFoundSageMakerFeatureStoreRuntime.Client.exceptions.InternalFailureSageMakerFeatureStoreRuntime.Client.exceptions.ServiceUnavailableSageMakerFeatureStoreRuntime.Client.exceptions.AccessForbidden