Rich-T-kid commented on code in PR #12119:
URL: https://github.com/apache/arrow-rs/pull/12119#discussion_r4504476154
##########
parquet/src/arrow/array_reader/fixed_len_byte_array.rs:
##########
@@ -202,21 +202,22 @@ impl ArrayReader for FixedLenByteArrayReader {
let len = self.record_reader.values_written();
let record_data = self.record_reader.consume_record_data();
- debug_assert_eq!(
- record_data.buffer.len(),
- len * self.byte_length,
- "fixed-len byte array buffer size mismatch: {} bytes for {}
elements of size {}",
- record_data.buffer.len(),
- len,
- self.byte_length,
- );
Review Comment:
nice, I think its better to replace this with actual validation.
##########
parquet/src/arrow/array_reader/fixed_len_byte_array.rs:
##########
@@ -202,21 +202,22 @@ impl ArrayReader for FixedLenByteArrayReader {
let len = self.record_reader.values_written();
let record_data = self.record_reader.consume_record_data();
- debug_assert_eq!(
- record_data.buffer.len(),
- len * self.byte_length,
- "fixed-len byte array buffer size mismatch: {} bytes for {}
elements of size {}",
- record_data.buffer.len(),
- len,
- self.byte_length,
- );
+ if record_data.buffer.len() != len * self.byte_length {
Review Comment:
can we actually make this a `checked_mul` just to avoid weird behavoir in
the unlikely case it overflows
--
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]