colinmarc commented on code in PR #1802:
URL: https://github.com/apache/iceberg-rust/pull/1802#discussion_r2490395075
##########
crates/iceberg/src/spec/table_metadata.rs:
##########
@@ -413,9 +415,24 @@ impl TableMetadata {
file_io: &FileIO,
metadata_location: impl AsRef<str>,
) -> Result<TableMetadata> {
- let input_file = file_io.new_input(metadata_location)?;
+ let input_file = file_io.new_input(metadata_location.as_ref())?;
let metadata_content = input_file.read().await?;
- let metadata =
serde_json::from_slice::<TableMetadata>(&metadata_content)?;
+
+ // Check if the file is compressed by looking for the gzip "magic
number".
+ let metadata = if metadata_content.len() > 2
+ && metadata_content[0] == 0x1F
+ && metadata_content[1] == 0x8B
+ {
Review Comment:
Would you like me to pull in a dependency? Neither `tracing` or `log` are
available here.
--
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]