-
Notifications
You must be signed in to change notification settings - Fork 155
Feature request: Enable TumblingWindow support for KinesisDataStreamRecord and DynamoDB #3915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not following, is this an issue to add these fields to the schemas in Parser or to support this behavior with Batch Processing? |
Add these fields to the schemas in Parser |
Cool, thanks. For Kinesis, we should add the fields mentioned above to this schema. For DynamoDB I am not sure how the new payload looks like, so we'll have to test before we know for sure. |
The new fields for DDB Stream are almost the same - or exactly the same - as the ones you need to add to Kinesis: {
"Records":[
{
"eventID":"1",
"eventName":"INSERT",
"eventVersion":"1.0",
"eventSource":"aws:dynamodb",
"awsRegion":"us-east-1",
"dynamodb":{
"Keys":{
"Id":{
"N":"101"
}
},
"NewImage":{
"Message":{
"S":"New item!"
},
"Id":{
"N":"101"
}
},
"SequenceNumber":"111",
"SizeBytes":26,
"StreamViewType":"NEW_AND_OLD_IMAGES"
},
"eventSourceARN":"stream-ARN"
},
{
"eventID":"2",
"eventName":"MODIFY",
"eventVersion":"1.0",
"eventSource":"aws:dynamodb",
"awsRegion":"us-east-1",
"dynamodb":{
"Keys":{
"Id":{
"N":"101"
}
},
"NewImage":{
"Message":{
"S":"This item has changed"
},
"Id":{
"N":"101"
}
},
"OldImage":{
"Message":{
"S":"New item!"
},
"Id":{
"N":"101"
}
},
"SequenceNumber":"222",
"SizeBytes":59,
"StreamViewType":"NEW_AND_OLD_IMAGES"
},
"eventSourceARN":"stream-ARN"
},
{
"eventID":"3",
"eventName":"REMOVE",
"eventVersion":"1.0",
"eventSource":"aws:dynamodb",
"awsRegion":"us-east-1",
"dynamodb":{
"Keys":{
"Id":{
"N":"101"
}
},
"OldImage":{
"Message":{
"S":"This item has changed"
},
"Id":{
"N":"101"
}
},
"SequenceNumber":"333",
"SizeBytes":38,
"StreamViewType":"NEW_AND_OLD_IMAGES"
},
"eventSourceARN":"stream-ARN"
}
],
"window": {
"start": "2020-07-30T17:00:00Z",
"end": "2020-07-30T17:05:00Z"
},
"state": {
"1": "state1"
},
"shardId": "shard123456789",
"eventSourceARN": "stream-ARN",
"isFinalInvokeForWindow": false,
"isWindowTerminatedEarly": false
} |
Thank you, adding the |
@dreamorosi |
Thank you @kiitosu, I have assigned the issue to you - let me know if you have any questions, otherwise happy to iterate on the pull request once it's ready! |
Use case
Original issue: aws-powertools/powertools-lambda-python#6627
To implement stateful Kinesis Data Streams, customers can enable tumbling window in their ESM configuration for Kinesis and DynamoDB stream. When they do this, the payload has some extra keys such as
window
,state
,shardId
,isFinalInvokeForWindow
andisWindowTerminatedEarly
.While adding these fields to our zod schemas is enough to parse events, we still need to discuss - in a separate issue maybe - how to modify our BatchProcessing utility to support these scenarios, as we need to return an additional
state
field when using PartialFailure.Kinesis documentation: https://docs.aws.amazon.com/lambda/latest/dg/services-kinesis-windows.html
DynamoDB documentation: https://docs.aws.amazon.com/lambda/latest/dg/services-ddb-windows.html
Solution/User Experience
Add new fields.
Alternative solutions
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: