You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "1fanwang (via GitHub)" <gi...@apache.org> on 2026/09/08 01:27:58 UTC
Re: [PR] fix(puffin): implement LZ4 footer compression [iceberg-rust]
1fanwang commented on code in PR #2921:
URL: https://github.com/apache/iceberg-rust/pull/2921#discussion_r3953564403
##########
crates/iceberg/src/puffin/writer.rs:
##########
@@ -303,13 +303,52 @@ mod tests {
let blobs = vec![blob_0(), blob_1()];
let blobs_with_compression = blobs_with_compression(blobs.clone(), CompressionCodec::Lz4);
- assert_eq!(
- write_puffin_file(&temp_dir, blobs_with_compression, file_properties())
- .await
- .unwrap_err()
- .to_string(),
- "FeatureUnsupported => LZ4 compression is not supported currently"
- );
+ let input_file = write_puffin_file(&temp_dir, blobs_with_compression, file_properties())
+ .await
+ .unwrap()
+ .to_input_file();
+
+ assert_eq!(read_all_blobs_from_puffin_file(input_file).await, blobs);
+ }
+
+ #[tokio::test]
+ async fn test_compress_footer_lz4_round_trips() {
+ let temp_dir = TempDir::new().unwrap();
+ let file_io = FileIO::new_with_fs();
+ let path = temp_dir.path().join("compressed_footer.bin");
+ let output_file = file_io.new_output(path.to_str().unwrap()).unwrap();
+
+ let mut writer = PuffinWriter::new(&output_file, file_properties(), true)
+ .await
+ .unwrap();
+ writer.add(blob_0(), CompressionCodec::None).await.unwrap();
+ writer.close().await.unwrap();
+
+ let input_file = output_file.to_input_file();
+ let metadata = read_file_metadata(&input_file).await.unwrap();
+ assert_eq!(metadata.properties, file_properties());
+ assert_eq!(metadata.blobs.len(), 1);
+ assert_eq!(read_all_blobs_from_puffin_file(input_file).await, vec.
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org