MCPcopy Create free account
hub / github.com/apache/arrow / CheckRoundtripSpaced

Method CheckRoundtripSpaced

cpp/src/parquet/encoding_test.cc:337–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335 }
336
337 void CheckRoundtripSpaced(const uint8_t* valid_bits, int64_t valid_bits_offset) {
338 auto encoder =
339 MakeTypedEncoder<Type>(Encoding::PLAIN, /*use_dictionary=*/false, descr_.get());
340 auto decoder = MakeTypedDecoder<Type>(Encoding::PLAIN, descr_.get());
341 int null_count = 0;
342 for (auto i = 0; i < num_values_; i++) {
343 if (!bit_util::GetBit(valid_bits, valid_bits_offset + i)) {
344 null_count++;
345 }
346 }
347
348 encoder->PutSpaced(draws_, num_values_, valid_bits, valid_bits_offset);
349 encode_buffer_ = encoder->FlushValues();
350 decoder->SetData(num_values_ - null_count, encode_buffer_->data(),
351 static_cast<int>(encode_buffer_->size()));
352 auto values_decoded = decoder->DecodeSpaced(decode_buf_, num_values_, null_count,
353 valid_bits, valid_bits_offset);
354 ASSERT_EQ(num_values_, values_decoded);
355 ASSERT_NO_FATAL_FAILURE(VerifyResultsSpaced<c_type>(decode_buf_, draws_, num_values_,
356 valid_bits, valid_bits_offset));
357 }
358
359 protected:
360 USING_BASE_MEMBERS();

Callers

nothing calls this directly

Calls 8

GetBitFunction · 0.50
getMethod · 0.45
PutSpacedMethod · 0.45
FlushValuesMethod · 0.45
SetDataMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
DecodeSpacedMethod · 0.45

Tested by

no test coverage detected