SreeramGarlapati commented on code in PR #2537:
URL: https://github.com/apache/iceberg-rust/pull/2537#discussion_r3614759136
##########
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:
good catch @karuppayya - done in `a74ca1e1`.
confirmed against `BaseMetastoreTableOperations.parseVersion` - a
`v<n>.metadata.json` name has no `<version>-<uuid>` delimiter so java returns
`-1`, and the next file resets to `0` (`00000-<uuid>`). `with_next_version` now
does the same when `id == None`; updated
`test_java_hadoop_format_with_next_version` to pin it.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]