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 plain pages from dict-encoded (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao authored Feb 11, 2022
1 parent 48761ac commit 394a699
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/io/parquet/read/binary/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,6 @@ impl<'a, O: Offset> utils::Decoder<'a, &'a [u8], Binary<O>> for BinaryDecoder<O>
page.descriptor().type_().get_basic_info().repetition() == &Repetition::Optional;

match (page.encoding(), page.dictionary_page(), is_optional) {
(Encoding::Plain, None, true) => {
let (_, _, values, _) = utils::split_buffer(page, page.descriptor());

let values = BinaryIter::new(values);

Ok(State::Optional(OptionalPageValidity::new(page), values))
}
(Encoding::Plain, None, false) => Ok(State::Required(Required::new(page))),
(Encoding::PlainDictionary | Encoding::RleDictionary, Some(dict), false) => {
Ok(State::RequiredDictionary(RequiredDictionary::new(
page,
Expand All @@ -215,6 +207,14 @@ impl<'a, O: Offset> utils::Decoder<'a, &'a [u8], Binary<O>> for BinaryDecoder<O>
dict.as_any().downcast_ref().unwrap(),
)))
}
(Encoding::Plain, _, true) => {
let (_, _, values, _) = utils::split_buffer(page, page.descriptor());

let values = BinaryIter::new(values);

Ok(State::Optional(OptionalPageValidity::new(page), values))
}
(Encoding::Plain, _, false) => Ok(State::Required(Required::new(page))),
_ => Err(utils::not_implemented(
&page.encoding(),
is_optional,
Expand Down

0 comments on commit 394a699

Please sign in to comment.