-
Notifications
You must be signed in to change notification settings - Fork 4.1k
GH-15052: [C++][Parquet] Fix DELTA_BINARY_PACKED decoder when reading only one value #15124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
fe6ceea
2adb755
f978e25
0abb863
3c0a611
2461292
a019574
c85651c
7125483
1cf2511
18c5964
be8436c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2372,7 +2372,7 @@ class DeltaBitPackDecoder : public DecoderImpl, virtual public TypedDecoder<DTyp | |
| // DeltaByteArrayDecoder | ||
| void SetDecoder(int num_values, std::shared_ptr<::arrow::bit_util::BitReader> decoder) { | ||
| this->num_values_ = num_values; | ||
| decoder_ = decoder; | ||
| decoder_ = std::move(decoder); | ||
| InitHeader(); | ||
| } | ||
|
|
||
|
|
@@ -2459,7 +2459,9 @@ class DeltaBitPackDecoder : public DecoderImpl, virtual public TypedDecoder<DTyp | |
| ParquetException::EofException(); | ||
| } | ||
| if (bit_width_data[i] > kMaxDeltaBitWidth) { | ||
| throw ParquetException("delta bit width larger than integer bit width"); | ||
| throw ParquetException("delta bit width " + std::to_string(bit_width_data[i]) + | ||
| " larger than integer bit width " + | ||
| std::to_string(kMaxDeltaBitWidth)); | ||
| } | ||
| } | ||
| mini_block_idx_ = 0; | ||
|
|
@@ -2479,7 +2481,12 @@ class DeltaBitPackDecoder : public DecoderImpl, virtual public TypedDecoder<DTyp | |
| if (ARROW_PREDICT_FALSE(values_current_mini_block_ == 0)) { | ||
| if (ARROW_PREDICT_FALSE(!block_initialized_)) { | ||
| buffer[i++] = last_value_; | ||
| if (ARROW_PREDICT_FALSE(i == max_values)) break; | ||
| if (ARROW_PREDICT_FALSE(i == max_values)) { | ||
mapleFU marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (i != static_cast<int>(total_value_count_)) { | ||
| InitBlock(); | ||
| } | ||
mapleFU marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| break; | ||
| } | ||
|
Comment on lines
2481
to
+2497
Member
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. I find this difficult to read, could you add a comment about what this logic is doing?
Member
Author
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. To be honest, the logic is a bit trickey here, I will try to explain it. I'm bad in English, so maybe you can edit it directly if you can explain it better. |
||
| InitBlock(); | ||
| } else { | ||
| ++mini_block_idx_; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.