rok commented on code in PR #14959:
URL: https://github.com/apache/arrow/pull/14959#discussion_r1052413882


##########
cpp/src/parquet/encoding_test.cc:
##########
@@ -1290,6 +1290,7 @@ class TestDeltaBitPackEncoding : public 
TestEncodingBase<Type> {
  public:
   using c_type = typename Type::c_type;
   static constexpr int TYPE = Type::type_num;
+  static constexpr size_t ROUND_TRIP_TIME = 3;

Review Comment:
   ```suggestion
     static constexpr size_t ROUND_TRIP_TIMES = 3;
   ```



##########
cpp/src/parquet/encoding_test.cc:
##########
@@ -1350,15 +1353,17 @@ class TestDeltaBitPackEncoding : public 
TestEncodingBase<Type> {
       }
     }
 
-    encoder->PutSpaced(draws_, num_values_, valid_bits, valid_bits_offset);
-    encode_buffer_ = encoder->FlushValues();
-    decoder->SetData(num_values_ - null_count, encode_buffer_->data(),
-                     static_cast<int>(encode_buffer_->size()));
-    auto values_decoded = decoder->DecodeSpaced(decode_buf_, num_values_, 
null_count,
-                                                valid_bits, valid_bits_offset);
-    ASSERT_EQ(num_values_, values_decoded);
-    ASSERT_NO_FATAL_FAILURE(VerifyResultsSpaced<c_type>(decode_buf_, draws_, 
num_values_,
-                                                        valid_bits, 
valid_bits_offset));
+    for (size_t i = 0; i < ROUND_TRIP_TIME; ++i) {

Review Comment:
   ```suggestion
       for (size_t i = 0; i < ROUND_TRIP_TIMES; ++i) {
   ```



##########
cpp/src/parquet/encoding.cc:
##########
@@ -2282,6 +2282,11 @@ std::shared_ptr<Buffer> 
DeltaBitPackEncoder<DType>::FlushValues() {
   std::memcpy(buffer->mutable_data() + offset_bytes, header_buffer_,
               header_writer.bytes_written());
 
+  // reset counter

Review Comment:
   ```suggestion
     // Reset counter of cached values
   ```



##########
cpp/src/parquet/encoding_test.cc:
##########
@@ -1328,14 +1329,16 @@ class TestDeltaBitPackEncoding : public 
TestEncodingBase<Type> {
         MakeTypedEncoder<Type>(Encoding::DELTA_BINARY_PACKED, false, 
descr_.get());
     auto decoder = MakeTypedDecoder<Type>(Encoding::DELTA_BINARY_PACKED, 
descr_.get());
 
-    encoder->Put(draws_, num_values_);
-    encode_buffer_ = encoder->FlushValues();
+    for (size_t i = 0; i < ROUND_TRIP_TIME; ++i) {

Review Comment:
   ```suggestion
       for (size_t i = 0; i < ROUND_TRIP_TIMES; ++i) {
   ```



-- 
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]

Reply via email to