- Newest
- Most votes
- Most comments
Thank you for the response. FYI, I've determined that this is also a problem in step-functions when feeding the numeric results of a dynamodb getItem task into a Choice state: I cannot utilize any of the numeric comparison functions successfully; however, the string comparison operators do function as expected.
The root cause appears to be that the results for the numeric fields from dynamodb are being output from the getItem task as strings. Maybe this is something that can be addressed in an upcoming release? (Hopefully before too many people build convoluted work-arounds)
Hello,
Thank you for your post.
I am sharing the answer provided by my colleague on your question. Please review it below:
The "AttributeUpdates" API of DynamoDB accept only string value types for the N parameter[1] This will explain justify the error message observed.
Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations[2]. With this in mind I think your implemented workaround sounds good. Hope this explains your observation, meanwhile do not hesitate to contact us if you have any additional questions or concerns.
References:
[1] https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html
[2] https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html#DDB-Type-AttributeValue-N
Relevant content
- asked 4 years ago

I have to agree with @brad00, where are the very basic intrinsic functions like marshall and unmarshall. Or perhaps ParseInt etc. Additionally, having to use a Map State just to marshall a single "L" field we're trying to put into DDB is way too much work for what it is.
We took a very honest try with Step Functions to handle typical Lambda functions in native States but as with the above, it just feels like way too much convoluted work-arounds to very fundamental tasks.
Another simple example we're struggling with. Needing something like String.padStart() to prep a string like "10" into the field version of "Episode0010".