Skip to content

Conversation

@VVBondarenko
Copy link

added way to configure collection truncate approach in overwrite writing mode.

new write option: truncate_mode might have one of the following options:

  • DROP same as before. Just drop collection and create new one with default configuration
  • DELETE_ALL expensive delete all query. Keeps original collection, but slowly deletes all documents from it
  • RECREATE saves previous options and indexes, drops the collection, creates new collection with the same options and indexes

@jyemin jyemin marked this pull request as draft November 18, 2024 22:03
@rozza rozza added the external label Mar 4, 2025
@rozza rozza marked this pull request as ready for review March 4, 2025 17:30
@rozza rozza requested a review from a team as a code owner December 1, 2025 09:37
@rozza rozza requested review from rozza and strogiyotec and removed request for strogiyotec December 1, 2025 09:37
rozza added a commit to rozza/mongo-spark that referenced this pull request Dec 3, 2025
To allow the overwrite save mode to keep collection options

SPARK-384

Original PR: mongodb#123 - removed recreate mode due to fragility
---------

Co-authored-by: Ross Lawley <[email protected]>
@rozza
Copy link
Member

rozza commented Dec 3, 2025

Closed see: #144

I opted not to add RECREATE due to the fragility of the approach. Shard keys and other options would not be recreated.

@rozza rozza closed this Dec 3, 2025
rozza added a commit to rozza/mongo-spark that referenced this pull request Dec 3, 2025
To allow the overwrite save mode to keep collection options

SPARK-384

Original PR: mongodb#123 - removed recreate mode due to fragility
---------

Co-authored-by: Ross Lawley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants