You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/30 14:34:15 UTC
[GitHub] [arrow] rok commented on a diff in pull request #15124: GH-15052: [C++][Parquet] Fixing DELTA_BINARY_PACKED when reading only 1
rok commented on code in PR #15124:
URL: https://github.com/apache/arrow/pull/15124#discussion_r1059412808
##########
cpp/src/parquet/encoding.cc:
##########
@@ -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)) {
+ if (i != static_cast<int>(total_value_count_)) {
+ InitBlock();
+ }
+ break;
+ }
Review Comment:
I find this difficult to read, could you add a comment about what this logic is doing?
##########
cpp/src/parquet/encoding.cc:
##########
@@ -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));
Review Comment:
Nice!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org