Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Fixed error in reading fixed_len from parquet
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Oct 24, 2021
1 parent e6b6c83 commit 3d18dc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io/parquet/read/fixed_size_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub(crate) fn read_optional(
values: &mut MutableBuffer<u8>,
validity: &mut MutableBitmap,
) {
let length = values.len() * size + additional;
let length = values.len() + additional * size;

assert_eq!(values_buffer.len() % size, 0);
let mut values_iterator = values_buffer.chunks_exact(size);
Expand All @@ -89,7 +89,7 @@ pub(crate) fn read_optional(
match run {
hybrid_rle::HybridEncoded::Bitpacked(packed) => {
// the pack may contain more items than needed.
let remaining = length - values.len() * size;
let remaining = length * size - values.len();
let len = std::cmp::min(packed.len() * 8, remaining);
for is_valid in BitmapIter::new(packed, 0, len) {
validity.push(is_valid);
Expand Down

0 comments on commit 3d18dc7

Please sign in to comment.