-
Notifications
You must be signed in to change notification settings - Fork 11
Implement bulkUpsert for flat collections #269
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
Implement bulkUpsert for flat collections #269
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #269 +/- ##
============================================
+ Coverage 80.44% 80.52% +0.07%
Complexity 1396 1396
============================================
Files 239 239
Lines 6598 6695 +97
Branches 605 615 +10
============================================
+ Hits 5308 5391 +83
- Misses 888 900 +12
- Partials 402 404 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| LOGGER.error("SQLException in bulkUpsertAndReturnOlderDocuments. query: {}", selectQuery, e); | ||
| if (connection != null) { | ||
| try { | ||
| connection.close(); |
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.
what about closing prepared statement here? Also, can we try reducing the complexity of this function?
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.
Closing a connection would close the PS associated with it too. Yes, refactored this method.
|
LGTM |
| public boolean bulkUpsert(Map<Key, Document> documents) { | ||
| throw new UnsupportedOperationException(WRITE_NOT_SUPPORTED); | ||
| if (documents == null || documents.isEmpty()) { | ||
| return true; |
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.
Good place to log?
Description
This PR implements
Collection#bulkUpsertforFlatPostgresCollection.Testing
Added integration tests
Checklist:
Documentation
Note that based on the
MissingColumnStrategy, we either skip the corresponding docs (and), or just skip those columns, or throw an exception.