diff --git a/crates/iceberg/src/catalog/metadata_location.rs b/crates/iceberg/src/catalog/metadata_location.rs index acd041d5e1..35e6453916 100644 --- a/crates/iceberg/src/catalog/metadata_location.rs +++ b/crates/iceberg/src/catalog/metadata_location.rs @@ -83,7 +83,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(), + table_location: new_metadata.location.clone(), version: self.version, id: self.id, compression_codec: Self::compression_from_properties(new_metadata.properties()), diff --git a/crates/iceberg/src/catalog/mod.rs b/crates/iceberg/src/catalog/mod.rs index d2dc1ac1a0..f2d03f8e6c 100644 --- a/crates/iceberg/src/catalog/mod.rs +++ b/crates/iceberg/src/catalog/mod.rs @@ -2470,7 +2470,7 @@ mod tests { updated_table .metadata_location() .unwrap() - .starts_with("s3://bucket/test/location/metadata/00001-") + .starts_with("s3://bucket/test/new_location/data/metadata/00001-") ); assert_eq!(