-
Notifications
You must be signed in to change notification settings - Fork 54
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
Doesn't allow writing duplicates in bulk writer and corresponding tests #515
Conversation
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.
Overall looks great, just some minor comments.
Great work @tvaron3 , thanks!!
src/main/java/com/azure/cosmos/kafka/connect/CosmosDBConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/azure/cosmos/kafka/connect/CosmosDBConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/azure/cosmos/kafka/connect/CosmosDBConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/azure/cosmos/kafka/connect/CosmosDBConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/azure/cosmos/kafka/connect/CosmosDBConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/azure/cosmos/kafka/connect/sink/BulkWriter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/azure/cosmos/kafka/connect/sink/BulkWriter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/azure/cosmos/kafka/connect/sink/BulkWriter.java
Outdated
Show resolved
Hide resolved
src/test/java/com/azure/cosmos/kafka/connect/sink/BulkWriterTests.java
Outdated
Show resolved
Hide resolved
src/test/java/com/azure/cosmos/kafka/connect/sink/BulkWriterTests.java
Outdated
Show resolved
Hide resolved
LGTM - nit: can we please add the actual flag in the PR description? |
src/main/java/com/azure/cosmos/kafka/connect/sink/BulkWriter.java
Outdated
Show resolved
Hide resolved
I saw you updated, but I meant show the value that customer will need to update in their config file for the connector - I think its |
Theo I changed it again and the value they would need to change is "connect.cosmos.sink.bulk.compression.enabled". |
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.
LGTM, thanks @tvaron3 , great work :)
src/main/java/com/azure/cosmos/kafka/connect/CosmosDBConfig.java
Outdated
Show resolved
Hide resolved
Fixed wording of flag in documentation and changelog Co-authored-by: Kushagra Thapar <kuthapar@microsoft.com>
Type of PR
Purpose of PR
The bulk upsert operation will sometimes write data with duplicate id and partition key incorrectly. This change prevents duplicate items to be sent to the bulk upsert operation. It should only send the latest item. The feature is hidden behind a new config that is set to true by default. The flag added is called "connect.cosmos.sink.bulk.compression.enabled".
Observability + Testing
What changes or considerations did you make in relation to observability?
Did you add testing to account for any new or changed work?
I added a unit test and a integration test for the changes I made in the bulkwriter.
Review notes
Issues Closed or Referenced