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

Method CheckRoundtripSpaced

cpp/src/parquet/encoding_test.cc:2062–2083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2060 }
2061
2062 void CheckRoundtripSpaced(const uint8_t* valid_bits, int64_t valid_bits_offset) {
2063 auto encoder = MakeTypedEncoder<BooleanType>(Encoding::RLE,
2064 /*use_dictionary=*/false, descr_.get());
2065 auto decoder = MakeTypedDecoder<BooleanType>(Encoding::RLE, descr_.get());
2066 int null_count = 0;
2067 for (auto i = 0; i < num_values_; i++) {
2068 if (!bit_util::GetBit(valid_bits, valid_bits_offset + i)) {
2069 null_count++;
2070 }
2071 }
2072 for (int i = 0; i < 3; ++i) {
2073 encoder->PutSpaced(draws_, num_values_, valid_bits, valid_bits_offset);
2074 encode_buffer_ = encoder->FlushValues();
2075 decoder->SetData(num_values_ - null_count, encode_buffer_->data(),
2076 static_cast<int>(encode_buffer_->size()));
2077 auto values_decoded = decoder->DecodeSpaced(decode_buf_, num_values_, null_count,
2078 valid_bits, valid_bits_offset);
2079 ASSERT_EQ(num_values_, values_decoded);
2080 ASSERT_NO_FATAL_FAILURE(VerifyResultsSpaced<c_type>(
2081 decode_buf_, draws_, num_values_, valid_bits, valid_bits_offset));
2082 }
2083 }
2084};
2085
2086TEST_F(TestRleBooleanEncoding, BasicRoundTrip) {

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