-
Notifications
You must be signed in to change notification settings - Fork 853
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
Fixed EnhancedClient UpdateItem operation to make it work on nested attributes as well #5593
Changes from 50 commits
df37a55
1a2c32a
8c39b17
f431d6f
c6c2feb
58d223a
01584fe
559b7b4
b0b86be
f677cfd
cf96d13
c06c200
3a65dee
4080638
5f6232d
f2beece
ca54c25
5e1fff1
ac7033a
4793709
4909472
c599881
8a222ce
6e5e39a
7cedb09
950d308
7ea245d
459d040
f8500b3
1f56f0b
dcc3edc
374a917
3c9b67c
b144d62
5c7cbc7
d361c3b
f5e694c
149e90d
f35e858
ae8c56b
84e82db
7b5a488
7ce686c
46fd7c3
db3f2fc
711b020
9ba36aa
227d00f
abaa8de
435906c
405b65d
1fde90c
9c4d4e1
4ca8427
018bf42
d53c705
56da8c0
7cde360
74a6177
6fd1bf9
cee6627
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"type": "bugfix", | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "anirudh9391", | ||
"description": "Introduce a new method to transform input to be able to perform update operations on nested DynamoDB object attributes." | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This enum is new |
||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.enhanced.dynamodb.model; | ||
|
||
/** | ||
* This enum offers users different modes of performing DDB item updates | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This statement seems too generic |
||
* | ||
* In the SCALAR_ONLY mode, updates to nested scalar attributes are supported | ||
* | ||
* In the MAPS_ONLY mode, updates to nested map structures are supported | ||
* | ||
* The DEFAULT mode operates by setting ignoreNulls to false, and requires the user to | ||
* fetch existing DDB item, make modifications to it and then update the item | ||
*/ | ||
public enum IgnoreNullsMode { | ||
SCALAR_ONLY, | ||
MAPS_ONLY, | ||
DEFAULT | ||
Comment on lines
+35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the difference between MAPS_ONLY and DEFAULT? In the code, seems like we behave the same unless its There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. I have changed this and added a unit test.
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is different from the approved PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So just to confirm, MAPS_ONLY mode is what we originally supported with
ignoreNulls == true
, andSCALAR_ONLY
is new support we added?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that is correct. with MAPS_ONLY, essentially a new map is created as part of a every item update regardless of whether its scalar or non-scalar. This does not work for scalar updates, and hence the SCALAR_ONLY