Amazon SageMaker Feature Store Runtime 2020-07-01
- Client: Aws\SageMakerFeatureStoreRuntime\SageMakerFeatureStoreRuntimeClient
- Service ID: sagemaker-featurestore-runtime
- Version: 2020-07-01
This page describes the parameters and results for the operations of the Amazon SageMaker Feature Store Runtime (2020-07-01), and shows how to use the Aws\SageMakerFeatureStoreRuntime\SageMakerFeatureStoreRuntimeClient object to call the described operations. This documentation is specific to the 2020-07-01 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName'), where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */).
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */).
- BatchGetRecord ( array $params = [] )
- Retrieves a batch of Records from a FeatureGroup.
- BatchWriteRecord ( array $params = [] )
- Writes a batch of Records to one or more FeatureGroups.
- DeleteRecord ( array $params = [] )
- Deletes a Record from a FeatureGroup in the OnlineStore.
- GetRecord ( array $params = [] )
- Use for OnlineStore serving from a FeatureStore.
- ListRecords ( array $params = [] )
- Lists the RecordIdentifier values of all records stored in a FeatureGroup's OnlineStore.
- PutRecord ( array $params = [] )
- The PutRecord API is used to ingest a list of Records into your feature group.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
BatchGetRecord
$result = $client->batchGetRecord([/* ... */]); $promise = $client->batchGetRecordAsync([/* ... */]);
Retrieves a batch of Records from a FeatureGroup.
Parameter Syntax
$result = $client->batchGetRecord([
'ExpirationTimeResponse' => 'Enabled|Disabled',
'Identifiers' => [ // REQUIRED
[
'FeatureGroupName' => '<string>', // REQUIRED
'FeatureNames' => ['<string>', ...],
'RecordIdentifiersValueAsString' => ['<string>', ...], // REQUIRED
],
// ...
],
]);
Parameter Details
Members
- ExpirationTimeResponse
-
- Type: string
Parameter to request
ExpiresAtin response. IfEnabled,BatchGetRecordwill return the value ofExpiresAt, if it is not null. IfDisabledand null,BatchGetRecordwill return null. - Identifiers
-
- Required: Yes
- Type: Array of BatchGetRecordIdentifier structures
A list containing the name or Amazon Resource Name (ARN) of the
FeatureGroup, the list of names ofFeatures to be retrieved, and the correspondingRecordIdentifiervalues as strings.
Result Syntax
[
'Errors' => [
[
'ErrorCode' => '<string>',
'ErrorMessage' => '<string>',
'FeatureGroupName' => '<string>',
'RecordIdentifierValueAsString' => '<string>',
],
// ...
],
'Records' => [
[
'ExpiresAt' => '<string>',
'FeatureGroupName' => '<string>',
'Record' => [
[
'FeatureName' => '<string>',
'ValueAsString' => '<string>',
'ValueAsStringList' => ['<string>', ...],
],
// ...
],
'RecordIdentifierValueAsString' => '<string>',
],
// ...
],
'UnprocessedIdentifiers' => [
[
'FeatureGroupName' => '<string>',
'FeatureNames' => ['<string>', ...],
'RecordIdentifiersValueAsString' => ['<string>', ...],
],
// ...
],
]
Result Details
Members
- Errors
-
- Required: Yes
- Type: Array of BatchGetRecordError structures
A list of errors that have occurred when retrieving a batch of Records.
- Records
-
- Required: Yes
- Type: Array of BatchGetRecordResultDetail structures
A list of Records you requested to be retrieved in batch.
- UnprocessedIdentifiers
-
- Required: Yes
- Type: Array of BatchGetRecordIdentifier structures
A unprocessed list of
FeatureGroupnames, with their correspondingRecordIdentifiervalue, and Feature name.
Errors
- ValidationError:
There was an error validating your request.
- InternalFailure:
An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.
- ServiceUnavailable:
The service is currently unavailable.
- AccessForbidden:
You do not have permission to perform an action.
BatchWriteRecord
$result = $client->batchWriteRecord([/* ... */]); $promise = $client->batchWriteRecordAsync([/* ... */]);
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.
Parameter Syntax
$result = $client->batchWriteRecord([
'Entries' => [ // REQUIRED
[
'FeatureGroupName' => '<string>', // REQUIRED
'Record' => [ // REQUIRED
[
'FeatureName' => '<string>', // REQUIRED
'ValueAsString' => '<string>',
'ValueAsStringList' => ['<string>', ...],
],
// ...
],
'TargetStores' => ['<string>', ...],
'TtlDuration' => [
'Unit' => 'Seconds|Minutes|Hours|Days|Weeks', // REQUIRED
'Value' => <integer>, // REQUIRED
],
],
// ...
],
'TtlDuration' => [
'Unit' => 'Seconds|Minutes|Hours|Days|Weeks', // REQUIRED
'Value' => <integer>, // REQUIRED
],
]);
Parameter Details
Members
- Entries
-
- Required: Yes
- Type: Array of BatchWriteRecordEntry structures
A list of records to write. Each entry specifies the
FeatureGroup, the record data, and optionally target stores and a TTL duration. - TtlDuration
-
- Type: TtlDuration structure
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.
Result Syntax
[
'Errors' => [
[
'Entry' => [
'FeatureGroupName' => '<string>',
'Record' => [
[
'FeatureName' => '<string>',
'ValueAsString' => '<string>',
'ValueAsStringList' => ['<string>', ...],
],
// ...
],
'TargetStores' => ['<string>', ...],
'TtlDuration' => [
'Unit' => 'Seconds|Minutes|Hours|Days|Weeks',
'Value' => <integer>,
],
],
'ErrorCode' => '<string>',
'ErrorMessage' => '<string>',
],
// ...
],
'UnprocessedEntries' => [
[
'FeatureGroupName' => '<string>',
'Record' => [
[
'FeatureName' => '<string>',
'ValueAsString' => '<string>',
'ValueAsStringList' => ['<string>', ...],
],
// ...
],
'TargetStores' => ['<string>', ...],
'TtlDuration' => [
'Unit' => 'Seconds|Minutes|Hours|Days|Weeks',
'Value' => <integer>,
],
],
// ...
],
]
Result Details
Members
- Errors
-
- Required: Yes
- Type: Array of BatchWriteRecordError structures
A list of errors that occurred when writing records in the batch.
- UnprocessedEntries
-
- Required: Yes
- Type: Array of BatchWriteRecordEntry structures
A list of entries that were not processed. These entries can be retried.
Errors
- ValidationError:
There was an error validating your request.
- ResourceNotFound:
A resource that is required to perform an action was not found.
- InternalFailure:
An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.
- ServiceUnavailable:
The service is currently unavailable.
- AccessForbidden:
You do not have permission to perform an action.
Examples
Example 1: Write records to multiple feature groups
$result = $client->batchWriteRecord([
'Entries' => [
[
'FeatureGroupName' => 'my-feature-group',
'Record' => [
[
'FeatureName' => 'customer_id',
'ValueAsString' => 'cust-001',
],
[
'FeatureName' => 'age',
'ValueAsString' => '25',
],
],
],
],
]);
Result syntax:
[
'Errors' => [
],
'UnprocessedEntries' => [
],
]
DeleteRecord
$result = $client->deleteRecord([/* ... */]); $promise = $client->deleteRecordAsync([/* ... */]);
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 theOnlineStore, though the delete record marker is still written to theOfflineStore. -
HardDeletereturnsEventTime:400 ValidationExceptionto indicate that the delete operation failed. No delete record marker is written to theOfflineStore.
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.
Parameter Syntax
$result = $client->deleteRecord([
'DeletionMode' => 'SoftDelete|HardDelete',
'EventTime' => '<string>', // REQUIRED
'FeatureGroupName' => '<string>', // REQUIRED
'RecordIdentifierValueAsString' => '<string>', // REQUIRED
'TargetStores' => ['<string>', ...],
]);
Parameter Details
Members
- DeletionMode
-
- Type: string
The name of the deletion mode for deleting the record. By default, the deletion mode is set to
SoftDelete. - EventTime
-
- Required: Yes
- Type: string
Timestamp indicating when the deletion event occurred.
EventTimecan be used to query data at a certain point in time. - FeatureGroupName
-
- Required: Yes
- Type: string
The name or Amazon Resource Name (ARN) of the feature group to delete the record from.
- RecordIdentifierValueAsString
-
- Required: Yes
- Type: string
The value for the
RecordIdentifierthat uniquely identifies the record, in string format. - TargetStores
-
- Type: Array of strings
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.
Result Syntax
[]
Result Details
Errors
- ValidationError:
There was an error validating your request.
- InternalFailure:
An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.
- ServiceUnavailable:
The service is currently unavailable.
- AccessForbidden:
You do not have permission to perform an action.
GetRecord
$result = $client->getRecord([/* ... */]); $promise = $client->getRecordAsync([/* ... */]);
Use for OnlineStore serving from a FeatureStore. Only the latest records stored in the OnlineStore can be retrieved. If no Record with RecordIdentifierValue is found, then an empty result is returned.
Parameter Syntax
$result = $client->getRecord([
'ExpirationTimeResponse' => 'Enabled|Disabled',
'FeatureGroupName' => '<string>', // REQUIRED
'FeatureNames' => ['<string>', ...],
'RecordIdentifierValueAsString' => '<string>', // REQUIRED
]);
Parameter Details
Members
- ExpirationTimeResponse
-
- Type: string
Parameter to request
ExpiresAtin response. IfEnabled,GetRecordwill return the value ofExpiresAt, if it is not null. IfDisabledand null,GetRecordwill return null. - FeatureGroupName
-
- Required: Yes
- Type: string
The name or Amazon Resource Name (ARN) of the feature group from which you want to retrieve a record.
- FeatureNames
-
- Type: Array of strings
List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.
- RecordIdentifierValueAsString
-
- Required: Yes
- Type: string
The value that corresponds to
RecordIdentifiertype and uniquely identifies the record in theFeatureGroup.
Result Syntax
[
'ExpiresAt' => '<string>',
'Record' => [
[
'FeatureName' => '<string>',
'ValueAsString' => '<string>',
'ValueAsStringList' => ['<string>', ...],
],
// ...
],
]
Result Details
Members
- ExpiresAt
-
- Type: string
The
ExpiresAtISO string of the requested record. - Record
-
- Type: Array of FeatureValue structures
The record you requested. A list of
FeatureValues.
Errors
- ValidationError:
There was an error validating your request.
- ResourceNotFound:
A resource that is required to perform an action was not found.
- InternalFailure:
An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.
- ServiceUnavailable:
The service is currently unavailable.
- AccessForbidden:
You do not have permission to perform an action.
ListRecords
$result = $client->listRecords([/* ... */]); $promise = $client->listRecordsAsync([/* ... */]);
Lists the RecordIdentifier values of all records stored in a FeatureGroup's OnlineStore. This enables you to discover which records exist without retrieving the full record data.
Parameter Syntax
$result = $client->listRecords([
'FeatureGroupName' => '<string>', // REQUIRED
'IncludeSoftDeletedRecords' => true || false,
'MaxResults' => <integer>,
'NextToken' => '<string>',
]);
Parameter Details
Members
- FeatureGroupName
-
- Required: Yes
- Type: string
The name or Amazon Resource Name (ARN) of the feature group to list records from.
- IncludeSoftDeletedRecords
-
- Type: boolean
If set to
true, the result includes records that have been soft deleted. - MaxResults
-
- Type: int
The maximum number of record identifiers to return in a single page of results. For the
InMemorytier, this value is a hint and not a strict requirement. The response may contain more or fewer results than the specifiedMaxResults. - NextToken
-
- Type: string
A token to resume pagination of
ListRecordsresults.
Result Syntax
[
'NextToken' => '<string>',
'RecordIdentifiers' => ['<string>', ...],
]
Result Details
Members
- NextToken
-
- Type: string
A token to resume pagination if the response includes more record identifiers than
MaxResults. - RecordIdentifiers
-
- Required: Yes
- Type: Array of strings
A list of record identifier values for the records stored in the
OnlineStore.
Errors
- ValidationError:
There was an error validating your request.
- ResourceNotFound:
A resource that is required to perform an action was not found.
- InternalFailure:
An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.
- ServiceUnavailable:
The service is currently unavailable.
- AccessForbidden:
You do not have permission to perform an action.
Examples
Example 1: List record identifiers from a feature group
$result = $client->listRecords([
'FeatureGroupName' => 'my-feature-group',
'MaxResults' => 10,
]);
Result syntax:
[
'NextToken' => 'eyJsYXN0RXZhbHVhdGVkS2V5IjoiYWJjMTIzIn0=',
'RecordIdentifiers' => [
'record-id-1',
'record-id-2',
],
]
PutRecord
$result = $client->putRecord([/* ... */]); $promise = $client->putRecordAsync([/* ... */]);
The PutRecord API is used to ingest a list of Records into your feature group.
If a new record’s EventTime is greater, the new record is written to both the OnlineStore and OfflineStore. Otherwise, the record is a historic record and it is written only to the OfflineStore.
You can specify the ingestion to be applied to the OnlineStore, OfflineStore, or both by using the TargetStores request parameter.
You can set the ingested record to expire at a given time to live (TTL) duration after the record’s event time, ExpiresAt = EventTime + TtlDuration, by specifying the TtlDuration parameter. A record level TtlDuration is set when specifying the TtlDuration parameter using the PutRecord API call. If the input TtlDuration is null or unspecified, TtlDuration is set to the default feature group level TtlDuration. A record level TtlDuration supersedes the group level TtlDuration.
Parameter Syntax
$result = $client->putRecord([
'FeatureGroupName' => '<string>', // REQUIRED
'Record' => [ // REQUIRED
[
'FeatureName' => '<string>', // REQUIRED
'ValueAsString' => '<string>',
'ValueAsStringList' => ['<string>', ...],
],
// ...
],
'TargetStores' => ['<string>', ...],
'TtlDuration' => [
'Unit' => 'Seconds|Minutes|Hours|Days|Weeks', // REQUIRED
'Value' => <integer>, // REQUIRED
],
]);
Parameter Details
Members
- FeatureGroupName
-
- Required: Yes
- Type: string
The name or Amazon Resource Name (ARN) of the feature group that you want to insert the record into.
- Record
-
- Required: Yes
- Type: Array of FeatureValue structures
List of FeatureValues to be inserted. This will be a full over-write. If you only want to update few of the feature values, do the following:
-
Use
GetRecordto retrieve the latest record. -
Update the record returned from
GetRecord. -
Use
PutRecordto update feature values.
- TargetStores
-
- Type: Array of strings
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. - TtlDuration
-
- Type: TtlDuration structure
Time to live duration, where the record is hard deleted after the expiration time is reached;
ExpiresAt=EventTime+TtlDuration. For information on HardDelete, see the DeleteRecord API in the Amazon SageMaker API Reference guide.
Result Syntax
[]
Result Details
Errors
- ValidationError:
There was an error validating your request.
- InternalFailure:
An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.
- ServiceUnavailable:
The service is currently unavailable.
- AccessForbidden:
You do not have permission to perform an action.
Shapes
AccessForbidden
Description
You do not have permission to perform an action.
Members
- Message
-
- Type: string
BatchGetRecordError
Description
The error that has occurred when attempting to retrieve a batch of Records.
Members
- ErrorCode
-
- Required: Yes
- Type: string
The error code of an error that has occurred when attempting to retrieve a batch of Records. For more information on errors, see Errors.
- ErrorMessage
-
- Required: Yes
- Type: string
The error message of an error that has occurred when attempting to retrieve a record in the batch.
- FeatureGroupName
-
- Required: Yes
- Type: string
The name of the feature group that the record belongs to.
- RecordIdentifierValueAsString
-
- Required: Yes
- Type: string
The value for the
RecordIdentifierin string format of a Record from aFeatureGroupthat is causing an error when attempting to be retrieved.
BatchGetRecordIdentifier
Description
The identifier that identifies the batch of Records you are retrieving in a batch.
Members
- FeatureGroupName
-
- Required: Yes
- Type: string
The name or Amazon Resource Name (ARN) of the
FeatureGroupcontaining the records you are retrieving in a batch. - FeatureNames
-
- Type: Array of strings
List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.
- RecordIdentifiersValueAsString
-
- Required: Yes
- Type: Array of strings
The value for a list of record identifiers in string format.
BatchGetRecordResultDetail
Description
The output of records that have been retrieved in a batch.
Members
- ExpiresAt
-
- Type: string
The
ExpiresAtISO string of the requested record. - FeatureGroupName
-
- Required: Yes
- Type: string
The
FeatureGroupNamecontaining Records you retrieved in a batch. - Record
-
- Required: Yes
- Type: Array of FeatureValue structures
The
Recordretrieved. - RecordIdentifierValueAsString
-
- Required: Yes
- Type: string
The value of the record identifier in string format.
BatchWriteRecordEntry
Description
An entry to write as part of a BatchWriteRecord request.
Members
- FeatureGroupName
-
- Required: Yes
- Type: string
The name or Amazon Resource Name (ARN) of the
FeatureGroupto write the record to. - Record
-
- Required: Yes
- Type: Array of FeatureValue structures
List of FeatureValues to be inserted. This will be a full over-write.
- TargetStores
-
- Type: Array of strings
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. - TtlDuration
-
- Type: TtlDuration structure
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.
BatchWriteRecordError
Description
The error that has occurred when attempting to write a record in a batch.
Members
- Entry
-
- Required: Yes
- Type: BatchWriteRecordEntry structure
The entry that failed to be written.
- ErrorCode
-
- Required: Yes
- Type: string
The error code for the failed record write.
- ErrorMessage
-
- Required: Yes
- Type: string
The error message for the failed record write.
FeatureValue
Description
The value associated with a feature.
Members
- FeatureName
-
- Required: Yes
- Type: string
The name of a feature that a feature value corresponds to.
- ValueAsString
-
- Type: 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
-
- Type: Array of strings
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.
InternalFailure
Description
An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.
Members
- Message
-
- Type: string
ResourceNotFound
Description
A resource that is required to perform an action was not found.
Members
- Message
-
- Type: string
ServiceUnavailable
Description
The service is currently unavailable.
Members
- Message
-
- Type: string
TtlDuration
Description
Time to live duration, where the record is hard deleted after the expiration time is reached; ExpiresAt = EventTime + TtlDuration. For information on HardDelete, see the DeleteRecord API in the Amazon SageMaker API Reference guide.
Members
- Unit
-
- Required: Yes
- Type: string
TtlDurationtime unit. - Value
-
- Required: Yes
- Type: int
TtlDurationtime value.
ValidationError
Description
There was an error validating your request.
Members
- Message
-
- Type: string