DynamoDbIgnoreNulls Doesn't Work On Most Writes #2938
Labels
bug
This issue is a bug.
closed-for-staleness
dynamodb-enhanced
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Describe the bug
When a user performs dynamo writes with the enhanced aws client with transactWriteItems or putItems, "DynamoDbIgnoreNulls" doesn't cause the write to ignore null attributes on the record being written.
That is, from #2303 it sounds like using the annotation should work fluidly like the other annotations, but because DefaultDynamoDbEnhancedClient.java just makes a TransactWriteItemsEnhancedRequest and sends it to dynamo. It doesn't look at the record being written to see if certain fields shouldn't overwrite existing fields with null.
Let me know if user error! But certainly feels like this annotation does not work fluidly with this usage of the enhanced client. I'm forced to set
ignoreNulls
manually on my own instead of relying on the annotation.Expected behavior
"DynamoDbIgnoreNulls" should ignore null attributes on the record being written
Current behavior
"DynamoDbIgnoreNulls" doesn't ignore null attributes on the record being written
Steps to Reproduce
In the above, the second write deletes the pre-existing value of myAttribute.
Possible Solution
Maybe call itemToMap() somewhere around transactWriteItems? That seems how we get the information from the bean based on the annotations. Based on #2303
Context
No response
AWS Java SDK version used
2.17.91
JDK version used
11.0.12
Operating System and version
Mac Big Sur, 11.6.1
The text was updated successfully, but these errors were encountered: