CTTY commented on code in PR #2776:
URL: https://github.com/apache/iceberg-rust/pull/2776#discussion_r3609291287


##########
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 should throw error here, let's change the current method to 
`try_new_with_metadata` if needed



##########
crates/iceberg/src/catalog/metadata_location.rs:
##########
@@ -83,7 +84,7 @@ impl MetadataLocation {
     /// Updates the metadata location with compression settings from the new 
metadata.
     pub fn with_new_metadata(&self, new_metadata: &TableMetadata) -> Self {
         Self {
-            table_location: self.table_location.clone(),
+            location: self.location.clone(),

Review Comment:
   Should we honor the metadata path here as well? What's the expected behavior 
when `new_metadata` has a new metadata path?
   
   I haven't checked how it's like in java tho



-- 
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]

Reply via email to