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

Commit

Permalink
Fixed reading of dict-encoded, plain pages (fallback). (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao authored Sep 2, 2021
1 parent cef5f08 commit cef0dce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/io/parquet/read/binary/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ fn extend_from_page<O: Offset>(
values,
validity,
),
(Encoding::Plain, None, true) => read_plain_optional::<O>(
(Encoding::Plain, _, true) => read_plain_optional::<O>(
validity_buffer,
values_buffer,
page.num_values(),
offsets,
values,
validity,
),
(Encoding::Plain, None, false) => {
(Encoding::Plain, _, false) => {
read_plain_required::<O>(page.buffer(), page.num_values(), offsets, values)
}
_ => {
Expand Down
6 changes: 4 additions & 2 deletions src/io/parquet/read/fixed_size_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,17 @@ pub(crate) fn extend_from_page(
values,
validity,
),
(Encoding::Plain, None, true) => read_optional(
(Encoding::Plain, _, true) => read_optional(
validity_buffer,
values_buffer,
page.num_values() as u32,
size,
values,
validity,
),
(Encoding::Plain, None, false) => {
// it can happen that there is a dictionary but the encoding is plain because
// it falled back.
(Encoding::Plain, _, false) => {
read_required(page.buffer(), page.num_values() as u32, size, values)
}
_ => {
Expand Down
6 changes: 4 additions & 2 deletions src/io/parquet/read/primitive/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,17 @@ where
op,
)
}
(Encoding::Plain, None, true) => read_nullable(
// it can happen that there is a dictionary but the encoding is plain because
// it falled back.
(Encoding::Plain, _, true) => read_nullable(
validity_buffer,
values_buffer,
additional,
values,
validity,
op,
),
(Encoding::Plain, None, false) => read_required(page.buffer(), additional, values, op),
(Encoding::Plain, _, false) => read_required(page.buffer(), additional, values, op),
_ => {
return Err(other_utils::not_implemented(
&page.encoding(),
Expand Down

0 comments on commit cef0dce

Please sign in to comment.