Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/catalog/glue/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ impl Catalog for GlueCatalog {
&table_name,
metadata_location_str.clone(),
&metadata,
metadata.properties(),
metadata.properties().as_raw(),
None,
)?;

Expand Down Expand Up @@ -825,7 +825,7 @@ impl Catalog for GlueCatalog {
table_name,
metadata_location.clone(),
&metadata,
metadata.properties(),
metadata.properties().as_raw(),
None,
)?;

Expand Down Expand Up @@ -894,7 +894,7 @@ impl Catalog for GlueCatalog {
table_ident.name(),
staged_metadata_location.to_string(),
staged_table.metadata(),
staged_table.metadata().properties(),
staged_table.metadata().properties().as_raw(),
Some(current_metadata_location),
)?);

Expand Down
2 changes: 1 addition & 1 deletion crates/catalog/glue/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ mod tests {
&table_name,
metadata_location,
&metadata,
metadata.properties(),
metadata.properties().as_raw(),
None,
)?;

Expand Down
2 changes: 1 addition & 1 deletion crates/catalog/hms/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ impl Catalog for HmsCatalog {
table_name.clone(),
location,
metadata_location_str.clone(),
metadata.properties(),
metadata.properties().as_raw(),
)?;

self.client
Expand Down
6 changes: 3 additions & 3 deletions crates/catalog/rest/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,7 @@ mod tests {
"gzip".to_string()
)
]),
table.metadata().properties()
table.metadata().properties().as_raw()
);
assert_eq!(vec![&Arc::new(Snapshot::builder()
.with_snapshot_id(3497810964824022504)
Expand Down Expand Up @@ -2517,7 +2517,7 @@ mod tests {
"zstd".to_string()
),
]),
table.metadata().properties()
table.metadata().properties().as_raw()
);
assert!(table.metadata().current_snapshot().is_none());
assert!(table.metadata().history().is_empty());
Expand Down Expand Up @@ -2718,7 +2718,7 @@ mod tests {
"zstd".to_string()
),
]),
table.metadata().properties()
table.metadata().properties().as_raw()
);
assert!(table.metadata().current_snapshot().is_none());
assert!(table.metadata().history().is_empty());
Expand Down
2 changes: 1 addition & 1 deletion crates/catalog/sql/src/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ mod tests {
vec![&expected_sorted_order]
);

assert_eq!(metadata.properties(), &HashMap::new());
assert_eq!(metadata.properties().as_raw(), &HashMap::new());

assert!(!table.readonly());
}
Expand Down
2 changes: 1 addition & 1 deletion crates/iceberg/src/catalog/memory/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ pub(crate) mod tests {
vec![&expected_sorted_order]
);

assert_eq!(metadata.properties(), &HashMap::new());
assert_eq!(metadata.properties().as_raw(), &HashMap::new());

assert!(!table.readonly());
}
Expand Down
7 changes: 3 additions & 4 deletions crates/iceberg/src/catalog/metadata_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
// specific language governing permissions and limitations
// under the License.

use std::collections::HashMap;
use std::fmt::Display;
use std::str::FromStr;

use uuid::Uuid;

use crate::compression::CompressionCodec;
use crate::spec::{TableMetadata, parse_metadata_file_compression};
use crate::spec::{TableMetadata, TableProperties};
use crate::{Error, ErrorKind, Result};

/// Helper for parsing a location of the format: `<location>/metadata/<version>-<uuid>.metadata.json`
Expand All @@ -38,8 +37,8 @@ pub struct MetadataLocation {
impl MetadataLocation {
/// Determines the compression codec from table properties.
/// Parse errors result in CompressionCodec::None.
fn compression_from_properties(properties: &HashMap<String, String>) -> CompressionCodec {
parse_metadata_file_compression(properties).unwrap_or(CompressionCodec::None)
fn compression_from_properties(properties: &TableProperties) -> CompressionCodec {
properties.metadata_compression_codec
}

/// Creates a completely new metadata location starting at version 0.
Expand Down
2 changes: 1 addition & 1 deletion crates/iceberg/src/catalog/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub async fn drop_table_data(
}

// Delete data files only if gc.enabled is true, to avoid corrupting shared tables
if metadata.table_properties()?.gc_enabled {
if metadata.properties().gc_enabled {
delete_data_files(io, &manifests_to_delete).await?;
}

Expand Down
1 change: 0 additions & 1 deletion crates/iceberg/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pub use sort::*;
pub use statistic_file::*;
pub use table_metadata::*;
pub(crate) use table_metadata_builder::FIRST_FIELD_ID;
pub(crate) use table_properties::parse_metadata_file_compression;
pub use table_properties::*;
pub use transform::*;
pub(crate) use values::decimal_utils;
Expand Down
Loading
Loading