awslabs / aws-sdk-rust

AWS SDK for the Rust Programming Language
https://awslabs.github.io/aws-sdk-rust/
Apache License 2.0
2.91k stars 245 forks source link

add new option `overwrite_by_pkeys` for DynamoDB `batch_write_item` #1151

Open jetjinser opened 1 month ago

jetjinser commented 1 month ago

Describe the feature

like boto3: https://github.com/boto/boto3/blob/5eaa86735c78be7332fbc340813ba286a629f92b/boto3/dynamodb/table.py#L91 Avoid validation error "Provided list of item keys contains duplicates" when batch write item by auto de-dup.

Use Case

Now I have to manually remove duplicates, but AttributeValue does not implement the Eq, Ord and Hash traits, which complicates the implementation.

Proposed Solution

No response

Other Information

No response

Acknowledgements

A note for the community

Community Note

ysaito1001 commented 1 month ago

Thank you for submitting an enhancement request! Since the ability to remove duplicates is not modeled for the input to BatchWriteItem, the requested functionality will need to be implemented as some sort of a high level library (which is why you find it in boto3).