mmaitre314 opened a new issue, #5315:
URL: https://github.com/apache/arrow-rs/issues/5315
When opening a corrupted Parquet file where one of the row groups is missing
a column, `ParquetRecordBatchStreamBuilder::new()` panics instead of returning
an error:
```
A panic occurred at (...)\parquet-50.0.0\src\file\metadata.rs:352:
assertion `left == right` failed
left: 2
right: 1
```
This is due to the `RowGroupMetaData::from_thrift()` validating column
counts using the `assert_eq!()` macro:
https://github.com/apache/arrow-rs/blob/639e81e98c0962a2401f542dc1b7abcac4d3ea25/parquet/src/file/metadata.rs#L352
Could the check be replaced by an `if` statement returning an error? If that
sounds OK, I can prepare a PR for review.
As workaround, it is possible to unwind the panic and handle it almost like
a regular error. Unwinding async code is not straightforward though and it
would be simpler to allow consistent error handling.
```rust
let async_panic_handler = AssertUnwindSafe(async {
ParquetRecordBatchStreamBuilder::new(blob_reader).await }).catch_unwind().await;
if async_panic_handler.is_err() {
info!("Skipping Blob (invalid metadata)");
return Ok(())
}
let parquet_builder = async_panic_handler.unwrap()?;
```
--
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]