alamb commented on code in PR #5382:
URL: https://github.com/apache/arrow-rs/pull/5382#discussion_r1485569015
##########
parquet/src/file/serialized_reader.rs:
##########
@@ -1249,6 +1249,19 @@ mod tests {
Ok(())
}
+ #[test]
+ fn test_file_reader_invalid_metadata() {
+ let data = [
+ 255, 172, 1, 0, 50, 82, 65, 73, 1, 0, 0, 0, 169, 168, 168, 162,
87, 255, 16, 0, 0, 0,
+ 80, 65, 82, 49,
+ ];
+ let ret = SerializedFileReader::new(Bytes::copy_from_slice(&data));
+ assert_eq!(
+ ret.err().unwrap().to_string(),
+ "Parquet error: Could not parse metadata: bad data"
Review Comment:
It is unfortunate that this error message isn't more specific about what
part of the file is bad, but I don't think this PR makes it any better or worse
I ran this test without the changes in this PR and it paniced:
```
Running unittests src/lib.rs
(target/debug/deps/parquet-94528dc13c197da2)
return value should have been constructed
thread 'file::serialized_reader::tests::test_file_reader_invalid_metadata'
panicked at parquet/src/format.rs:4303:14:
return value should have been constructed
```
--
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]