alamb commented on code in PR #9365:
URL: https://github.com/apache/arrow-rs/pull/9365#discussion_r2795122514
##########
parquet/src/column/reader/decoder.rs:
##########
@@ -208,9 +208,10 @@ impl<T: DataType> ColumnValueDecoder for
ColumnValueDecoderImpl<T> {
}
let decoder = if encoding == Encoding::RLE_DICTIONARY {
- self.decoders[encoding as usize]
- .as_mut()
- .expect("Decoder for dict should have been set")
+ match self.decoders[encoding as usize].as_mut() {
Review Comment:
did you find some code path that can trigger this error?
##########
parquet/src/data_type.rs:
##########
@@ -1126,7 +1129,9 @@ pub(crate) mod private {
#[inline]
fn decode(buffer: &mut [Self], decoder: &mut PlainDecoderDetails) ->
Result<usize> {
- assert!(decoder.type_length > 0);
+ if decoder.type_length <= 0 {
+ return Err(general_err!("Type length must be positive ({}).",
decoder.type_length));
Review Comment:
I suggest we prefix these errors that are not expected with "Internal" or
something to make it clearer it is a bug in the decoder/library rather than bad
input data
For example
```suggestion
return Err(general_err!("Internal: Type length must be
positive ({}).", decoder.type_length));
```
--
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]