Copilot commented on code in PR #2921:
URL: https://github.com/apache/iceberg-rust/pull/2921#discussion_r3841150484


##########
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![

Review Comment:
   `test_compress_footer_lz4_round_trips` exercises the writer/reader path, but 
it doesn’t assert that the footer was *actually written* in LZ4 form (it would 
still pass if `compress_footer` were ignored and the footer stayed uncompressed 
JSON). Consider asserting against the raw footer payload bytes (e.g., LZ4 frame 
magic) so the test will catch regressions in the footer-compression 
flag/encoding.



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