You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "karuppayya (via GitHub)" <gi...@apache.org> on 2026/07/06 05:19:04 UTC

Re: [PR] fix: support Java HadoopCatalog's v.metadata.json naming [iceberg-rust]

karuppayya commented on code in PR #2537:
URL: https://github.com/apache/iceberg-rust/pull/2537#discussion_r3526550024


##########
crates/iceberg/src/catalog/metadata_location.rs:
##########
@@ -121,27 +123,42 @@ impl MetadataLocation {
             (stripped, CompressionCodec::None)
         };
 
-        let (version, id) = stripped.split_once('-').ok_or(Error::new(
+        // Try standard iceberg-rust format: <version>-<uuid>
+        if let Some((version_str, id_str)) = stripped.split_once('-')
+            && let (Ok(version), Ok(id)) = (version_str.parse::<i32>(), Uuid::parse_str(id_str))
+        {
+            return Ok((version, Some(id), compression_codec));
+        }
+
+        // Try Java HadoopCatalog format: v<version>

Review Comment:
   Looked at how Java handles the equivalent case: instead of continuing the existing version sequence, it resets and [starts numbering from 0](https://github.com/apache/iceberg/blob/f636995eb1cb22a34b8a4c83d05e4ce7ee905496/core/src/main/java/org/apache/iceberg/BaseMetastoreTableOperations.java#L149-L165).
   Its cosmetic, but good to keep the behavior consistent.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org