CTTY commented on code in PR #2776:
URL: https://github.com/apache/iceberg-rust/pull/2776#discussion_r3609298360
##########
crates/iceberg/src/catalog/metadata_location.rs:
##########
@@ -42,27 +49,21 @@ impl MetadataLocation {
parse_metadata_file_compression(properties).unwrap_or(CompressionCodec::None)
}
- /// Creates a completely new metadata location starting at version 0.
- /// Only used for creating a new table. For updates, see `next_version`.
- #[deprecated(
- since = "0.8.0",
- note = "Use new_with_metadata instead to properly handle compression
settings"
- )]
- pub fn new_with_table_location(table_location: impl ToString) -> Self {
- Self {
- table_location: table_location.to_string(),
- version: 0,
- id: Uuid::new_v4(),
- compression_codec: CompressionCodec::None,
- }
- }
-
/// Creates a completely new metadata location starting at version 0,
/// with compression settings from the table metadata.
/// Only used for creating a new table. For updates, see `next_version`.
+ ///
+ /// The metadata directory honors the `write.metadata.path` table property
when set,
+ /// otherwise defaults to the `metadata` subdirectory of `table_location`.
pub fn new_with_metadata(table_location: impl ToString, metadata:
&TableMetadata) -> Self {
+ let table_location = table_location.to_string();
+ let location = metadata
+ .table_properties()
+ .ok()
Review Comment:
we can also reuse the table_metadata::metadata_location() after refactoring
--
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]