- Newest
- Most votes
- Most comments
Regarding your questions about Amazon SageMaker Feature Store's online store:
-
You're correct that BatchGetRecord has a limitation of retrieving up to 100 records at a time. This is a constraint of the API, and there isn't a way to fetch more than 100 records in a single API call from the online store. The online store is specifically designed for low-latency lookups of the latest feature values for real-time inference rather than bulk retrieval operations. If you need to access larger datasets, the offline store would be more appropriate as it's designed for historical data exploration, model training, and batch inference.
-
When using the
ingestDatamethod from the FeatureStoreManager in the Spark SDK, it performs an upsert operation. This means that if records with the same identifiers already exist in the feature group, they will be updated with the new values. If the records don't exist, they will be created. For the In-Memory tier of the online store, this behavior is consistent - the latest values for each record identifier will be maintained, overwriting previous values for the same identifiers. The operation adds the records to both the online and offline stores by default, unless you specifically configure it to target only one store.
Sources
Data sources and ingestion - Amazon SageMaker AI
Online store - Amazon SageMaker AI
Create, store, and share features with Feature Store - Amazon SageMaker AI
Amazon SageMaker Feature Store for machine learning (ML) – Amazon Web Services
PutRecord - Amazon SageMaker
answered a year ago
1: Is it possible to fetch more than 100 records from the Online Store at once? No, you cannot fetch more than 100 records at a time in a single BatchGetRecord call.
BatchGetRecord API strictly limits the request to maximum 100 records per call. This is a hard limit enforced by SageMaker Feature Store Online API. To fetch more than 100 records, you must:
- Paginate manually, split your list of record identifiers into chunks of 100 or less.
- Then call BatchGetRecord multiple times (parallel or sequentially).
Workaround Here’s a basic Python batching example:
def batch_get_records(client, identifiers, feature_group_name):
for i in range(0, len(identifiers), 100):
batch = identifiers[i:i+100]
response = client.batch_get_record(
Identifiers=[
{
'FeatureGroupName': feature_group_name,
'RecordIdentifiersValueAsString': [id for id in batch]
}
]
)
yield response['Records']
Q2: What happens during FeatureStoreManager.ingestData(df)? Upsert or snapshot? Yes, it performs an upsert, not a full snapshot.
- When you use FeatureStoreManager.ingestData(df) in Spark SDK (for Online Store), it writes each record using its record identifier (primary key + event time).
- If a record with the same record identifier already exists: --> It gets updated (upserted) with the new feature values.
- No snapshot or duplication occurs for the same record identifier.
This behavior applies to both standard Online Store and In-Memory Tier. Just make sure your eventTime values are set properly, since SageMaker uses them to resolve record versions.
answered a year ago
Relevant content
asked 5 years ago
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
