Anieway commented on code in PR #36183:
URL: https://github.com/apache/arrow/pull/36183#discussion_r1241078549
##########
cpp/src/parquet/encoding.cc:
##########
@@ -2189,7 +2193,13 @@ void DeltaBitPackEncoder<DType>::Put(const T* src, int
num_values) {
// making subtraction operations well-defined and correct even in case of
overflow.
// Encoded integers will wrap back around on decoding.
// See http://en.wikipedia.org/wiki/Modular_arithmetic#Integers_modulo_n
- deltas_[values_current_block_] = value - current_value_;
+ UT delta = value - current_value_;
+ //update blocks minimum delta
+ if(delta < min_delta_) min_delta_ = delta;
+ //calculate which block a maximum delta belongs to -> whole number division
+ const uint32_t
miniblock_index{values_current_block_/values_per_mini_block_};
+ if(delta > max_deltas_[miniblock_index])max_deltas_[miniblock_index] =
delta;
Review Comment:
You are right.
max_deltas_ should always be filled with UT::min (which is 0) at the start
of each new block.
(Similarly, min__delta_ should always start out as UT::max for each new
block)
I will fix this.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]