alamb commented on code in PR #1807:
URL: https://github.com/apache/arrow-rs/pull/1807#discussion_r891533251
##########
parquet/src/compression.rs:
##########
@@ -340,26 +341,46 @@ mod tests {
.expect("Error when compressing");
// Decompress with c2
- let mut decompressed_size = c2
+ let decompressed_size = c2
.decompress(compressed.as_slice(), &mut decompressed)
.expect("Error when decompressing");
assert_eq!(data.len(), decompressed_size);
- decompressed.truncate(decompressed_size);
assert_eq!(data, decompressed.as_slice());
+ decompressed.clear();
compressed.clear();
// Compress with c2
c2.compress(data, &mut compressed)
.expect("Error when compressing");
// Decompress with c1
- decompressed_size = c1
+ let decompressed_size = c1
.decompress(compressed.as_slice(), &mut decompressed)
.expect("Error when decompressing");
assert_eq!(data.len(), decompressed_size);
- decompressed.truncate(decompressed_size);
assert_eq!(data, decompressed.as_slice());
+
Review Comment:
I went through the changes in this test carefully and they look good to me 👍
##########
parquet/src/compression.rs:
##########
@@ -111,9 +111,10 @@ mod snappy_codec {
output_buf: &mut Vec<u8>,
) -> Result<usize> {
let len = decompress_len(input_buf)?;
- output_buf.resize(len, 0);
+ let offset = output_buf.len();
Review Comment:
I reviewed the other `impl Codec` in this file and they appear to be
appending to `output_buf` as well 👍
https://sourcegraph.com/github.com/apache/arrow-rs/-/blob/parquet/src/compression.rs?subtree=true
--
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]