JingsongLi commented on code in PR #1023:
URL: https://github.com/apache/paimon-rust/pull/1023#discussion_r4176818981


##########
crates/paimon/src/table/tag_manager.rs:
##########
@@ -269,6 +269,33 @@ impl TagManager {
         self.file_io.delete_file(&path).await
     }
 
+    /// Rename a tag, preserving its snapshot pointer and the `tagCreateTime` /
+    /// `tagTimeRetained` metadata by moving the raw tag file. Errors if the
+    /// source tag is missing or the target name already exists.
+    ///
+    /// Uses copy-then-delete rather than a native rename: object stores and 
the
+    /// in-memory backend do not support rename.
+    pub async fn rename(&self, tag_name: &str, target_tag_name: &str) -> 
crate::Result<()> {
+        validate_tag_name(tag_name)?;
+        validate_tag_name(target_tag_name)?;
+        let src = self.tag_path(tag_name);
+        let dst = self.tag_path(target_tag_name);
+        if !self.file_io.new_input(&src)?.exists().await? {
+            return Err(crate::Error::DataInvalid {
+                message: format!("tag '{tag_name}' does not exist"),
+                source: None,
+            });
+        }
+        if self.file_io.new_input(&dst)?.exists().await? {
+            return Err(crate::Error::DataInvalid {
+                message: format!("tag '{target_tag_name}' already exists"),
+                source: None,
+            });
+        }
+        self.file_io.copy_file(&src, &dst).await?;

Review Comment:
   Withdrawn as a blocking finding. The intended compatibility scope accepts 
Java's object-storage rename limitations, including non-atomic copy/delete 
behavior. The local concurrent collision reproduced during review remains a 
limitation, but no stronger guarantee than Java is requested here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to