This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 224
Fixed reading parquet binary dict page #791
Merged
jorgecarleitao
merged 5 commits into
jorgecarleitao:main
from
danburkert:parquet-binary-dict-read
Jan 27, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8d7cb88
nullable-dict-decode
danburkert b6f7411
add equivalent debug asserts to more page types
danburkert 573b1c4
Update src/io/parquet/read/binary/basic.rs
danburkert 542b4e9
more bugs
danburkert bf675a2
skip len checks on nested pages
danburkert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,16 +117,13 @@ pub(super) fn extend_from_decoder<'a, T: Default, C: Pushable<T>, I: Iterator<It | |
values: &mut C, | ||
mut values_iter: I, | ||
) { | ||
let remaining = page_length; | ||
let mut remaining = page_length; | ||
for run in decoder { | ||
match run { | ||
hybrid_rle::HybridEncoded::Bitpacked(pack) => { | ||
// compute the length of the pack | ||
let pack_size = pack.len() * 8; | ||
let pack_remaining = page_length; | ||
let length = std::cmp::min(pack_size, pack_remaining); | ||
|
||
let additional = remaining.min(length); | ||
let additional = pack_size.min(remaining); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the full page length instead of the remaining length is one of the bugs. |
||
|
||
// extend validity | ||
validity.extend_from_slice(pack, 0, additional); | ||
|
@@ -140,13 +137,13 @@ pub(super) fn extend_from_decoder<'a, T: Default, C: Pushable<T>, I: Iterator<It | |
values.push_null() | ||
}; | ||
} | ||
|
||
remaining -= additional; | ||
} | ||
hybrid_rle::HybridEncoded::Rle(value, length) => { | ||
hybrid_rle::HybridEncoded::Rle(value, additional) => { | ||
let is_set = value[0] == 1; | ||
|
||
// extend validity | ||
let length = length; | ||
let additional = remaining.min(length); | ||
validity.extend_constant(additional, is_set); | ||
|
||
// extend values | ||
|
@@ -155,9 +152,13 @@ pub(super) fn extend_from_decoder<'a, T: Default, C: Pushable<T>, I: Iterator<It | |
} else { | ||
values.extend_constant(additional, T::default()); | ||
} | ||
|
||
remaining -= additional; | ||
} | ||
} | ||
} | ||
|
||
debug_assert_eq!(remaining, 0); | ||
} | ||
|
||
pub(super) fn read_dict_optional<K>( | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameter mixup; extend_from_decoder expects the additional length, but this was passing total length.