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

Method CheckRoundtrip

cpp/src/parquet/encoding_test.cc:319–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317 static constexpr int TYPE = Type::type_num;
318
319 virtual void CheckRoundtrip() {
320 auto encoder =
321 MakeTypedEncoder<Type>(Encoding::PLAIN, /*use_dictionary=*/false, descr_.get());
322 auto decoder = MakeTypedDecoder<Type>(Encoding::PLAIN, descr_.get());
323 encoder->Put(draws_, num_values_);
324 encode_buffer_ = encoder->FlushValues();
325 if constexpr (std::is_same_v<Type, ByteArrayType>) {
326 ASSERT_EQ(encoder->ReportUnencodedDataBytes(),
327 this->unencoded_byte_array_data_bytes_);
328 }
329
330 decoder->SetData(num_values_, encode_buffer_->data(),
331 static_cast<int>(encode_buffer_->size()));
332 int values_decoded = decoder->Decode(decode_buf_, num_values_);
333 ASSERT_EQ(num_values_, values_decoded);
334 ASSERT_NO_FATAL_FAILURE(VerifyResults<c_type>(decode_buf_, draws_, num_values_));
335 }
336
337 void CheckRoundtripSpaced(const uint8_t* valid_bits, int64_t valid_bits_offset) {
338 auto encoder =

Callers

nothing calls this directly

Calls 8

getMethod · 0.45
PutMethod · 0.45
FlushValuesMethod · 0.45
SetDataMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
DecodeMethod · 0.45

Tested by

no test coverage detected