-
Notifications
You must be signed in to change notification settings - Fork 910
DynamoDB Enhanced BooleanAttributeConverter cannot convert N value of 0 and 1 to Boolean #1912
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
Closed
1 task done
Labels
Comments
Thank you for reporting this issue @ryanthon. I see how this is impacting the ones who want to migrate to DynamoDB Enhanced. |
millems
added a commit
that referenced
this issue
Jul 8, 2020
…n values. The 1.11.x DynamoDB mapper persisted booleans as 0s and 1s (in the 'number' type). For backwards-compatibility, we should be able to read these values. The values will be converted to boolean types if they are written back to DynamoDB. Fixes #1912
millems
added a commit
that referenced
this issue
Jul 8, 2020
…n values. The 1.11.x DynamoDB mapper persisted booleans as 0s and 1s (in the 'number' type). For backwards-compatibility, we should be able to read these values. The values will be converted to boolean types if they are written back to DynamoDB. Fixes #1912
Would it be possible to get this opened back up? I'm still seeing this issue in 2.16.78. The fix was to use the above wrapper that the OP had. |
@deathrowe please open a new issue, and provide all the information we ask in the new issue template. |
aws-sdk-java-automation
added a commit
that referenced
this issue
Jan 25, 2022
…371f5dc3b Pull request: release <- staging/9bf14c90-ed46-4a40-b554-94e371f5dc3b
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Feature
DynamoDBMapper of the v1 SDK used to store boolean as N values of 0 and 1 in the table.
However, the default BooleanAttributeConverter is unable to convert those values to Boolean, and throws an IllegalStateException when attempting to do so.
I had to write my own wrapper class to check for a N type manually:
Is your Feature Request related to a problem?
As a result of the DynamoDBMapper behavior, I currently have a bunch of rows that have these values in my table.
I feel like DynamoDB-Enhanced should support that type of conversion, especially since that's how it was with DynamoDBMapper, and I think a lot of people will have this issue when migrating.
Proposed Solution
Have BooleanAttributeConverter support converting N values of 0 and 1 to Java Boolean.
Your Environment
The text was updated successfully, but these errors were encountered: