Rich-T-kid commented on code in PR #11912:
URL: https://github.com/apache/arrow-rs/pull/11912#discussion_r4404076888
##########
arrow-row/src/fixed.rs:
##########
@@ -402,30 +405,35 @@ pub fn decode_bool(rows: &mut [&[u8]], options:
SortOptions) -> BooleanArray {
let nulls = NullBuffer::new(BooleanBuffer::new(nulls.into(), 0, len));
let nulls = (nulls.null_count() > 0).then_some(nulls);
- BooleanArray::new(BooleanBuffer::new(values.into(), 0, len), nulls)
+ Ok(BooleanArray::new(
+ BooleanBuffer::new(values.into(), 0, len),
+ nulls,
+ ))
}
/// Decodes a single byte from each row, interpreting `0x01` as a valid value
/// and all other values as a null. Optionally returns `None` if there are no
/// null values.
-pub fn decode_nulls(rows: &[&[u8]]) -> Option<NullBuffer> {
- let nulls = BooleanBuffer::collect_bool(rows.len(), |idx| rows[idx][0] ==
1);
+pub fn decode_nulls(rows: &[&[u8]]) -> Result<Option<NullBuffer>, ArrowError> {
Review Comment:
same idea here
--
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]