Skip to content

Conversation

@crepererum
Copy link
Contributor

Which issue does this PR close?

This helps #385 and #297.

Rationale for this change

Change the ObjectStore core trait to have a single, extensible copy operation.

Also adds extensions similar to
apache/arrow-rs#7170
and
apache/arrow-rs#7213 .

Also see #548 for the same change that was made for copy.

What changes are included in this PR?

Interface change, see section below.

Are there any user-facing changes?

  • new core method rename_opts alongside RenameOptions & RenameMode
  • rename & rename_if_not_exists are moved to ObjectStoreExt

Change the `ObjectStore` core trait to have a single, extensible rename
operation. This helps apache#385 and apache#297.

Also adds extensions similar to 
apache/arrow-rs#7170
and
apache/arrow-rs#7213 .

Also see apache#548 -- which did something similar for `copy`.
@crepererum crepererum force-pushed the crepererum/rename-opts branch from c874ee2 to d9e7af3 Compare November 26, 2025 12:39
@alamb alamb changed the title refactor!: rename & rename_if_not_exists => rename_opts refactor!: Consolidate ObjectStore: rename & rename_if_not_exists => rename_opts Dec 4, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me -- thank you @crepererum

I found it interesting that the S3/Azure clients don't actually use the underlying rename APIs yet (the clients implement rename as copy then delete)


impl Eq for CopyOptions {}

/// Configure preconditions for the target of rename operation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some research about the names used in cloud providers

S3 uses the term If-None-Match for the "don't overwrite" method: https://docs.aws.amazon.com/AmazonS3/latest/API/API_RenameObject.html

From what I can tell, GCP doesn't support an atoimic rename/overwrite operation. If you want to overwrite you have to delete the target first : https://docs.cloud.google.com/storage/docs/copying-renaming-moving-objects

Azure Blob Storage calls it "replace if exists", specifically https://learn.microsoft.com/en-us/rest/api/storageservices/rename-file x-ms-file-rename-replace-if-exists

So TLDR I think these options are well named and reflect the available capabilities 👍

@crepererum crepererum merged commit e00ff79 into apache:main Dec 4, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants