[
https://issues.apache.org/jira/browse/BEAM-10706?focusedWorklogId=523225&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-523225
]
ASF GitHub Bot logged work on BEAM-10706:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Dec/20 15:16
Start Date: 11/Dec/20 15:16
Worklog Time Spent: 10m
Work Description: iemejia commented on a change in pull request #12583:
URL: https://github.com/apache/beam/pull/12583#discussion_r534495045
##########
File path:
sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/dynamodb/DynamoDBIO.java
##########
@@ -358,7 +363,18 @@ public boolean test(Throwable throwable) {
abstract Builder<T> setWriteItemMapperFn(
SerializableFunction<T, KV<String, WriteRequest>> writeItemMapperFn);
- abstract Write<T> build();
+ abstract Builder<T> setOverwriteByPKeys(List<String> overwriteByPKeys);
+
+ abstract Write<T> autoBuild();
+
+ abstract Optional<List<String>> getOverwriteByPKeys();
Review comment:
Can you please remove any `Optional` use. We can set the default value
to an empty collection on the write method by default and get the same effect:
```java
public static <T> Write<T> write() {
return new AutoValue_DynamoDBIO_Write.Builder().setOverwriteByPKeys(new
ArrayList<>()).build();
}
```
and then the build/autoBuild bits as they are in current master, it should
work.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 523225)
Time Spent: 5h (was: 4h 50m)
> DynamoDBIO fail to write to the same key in short consecution
> -------------------------------------------------------------
>
> Key: BEAM-10706
> URL: https://issues.apache.org/jira/browse/BEAM-10706
> Project: Beam
> Issue Type: Bug
> Components: io-java-aws
> Affects Versions: 2.23.0
> Reporter: Dennis Yung
> Assignee: Dennis Yung
> Priority: P2
> Fix For: 2.27.0
>
> Time Spent: 5h
> Remaining Estimate: 0h
>
> Internally, DynamoDBIO.Write uses the batchWriteItem method from the AWS SDK
> to sink items. However, there is a limitation in the AWS SDK that a call to
> batchWriteItem cannot contain duplicate keys.
> Currently DynamoDBIO.Write performs no key deduplication before flushing a
> batch, which could cause ValidationException: Provided list of item keys
> contains duplicates, if consecutive updates to a single key is within the
> batch size (currently hardcoded to be 25).
> To fix this bug, the batch of write requests need to be deduplicated before
> being sent to batchRequest.addRequestItemsEntry
--
This message was sent by Atlassian Jira
(v8.3.4#803005)