0
votes

I have a dynamoDB table that I'm populating with PutDynamoDB, no problems, it has a hash key of "userid" and a range key of "timestamp", the epoch time of the event. Is it possible, using the GetDynamoDB processor, to get back all or part of the set of range keys associated with the hash ID? That is, if user 1 posts 5 times, I want to be able to issue a GetDynamoDB call with the userid value of 1, and get back an array of all 5 post times by user 1. If I only want the 3 posts made yesterday, I want to supply a greater than and less than value to the lookup query, so that I only recover those 3 records.

I've tried simply querying without a range key value, and have not had any luck. In dynamoDB's interface, I can issue a hash key with a "between" range for the sort key. Is it possible to do the same in nifi?

1

1 Answers

1
votes

I do not believe the GetDynamoDB processor allows this type of query. GetDynamoDB uses Dynamo's BatchGetItem API, which requires a complete set of keys for each item retrieved. In contrast, I believe the Query API is what you used in the DynamoDB console UI to request a set of multiple range key items for the same hash key.

The GetDynamoDB processor code certainly would be a good place to start if you wish to develop a processor that performs the query operation.