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

Method SetupEncoderDecoder

cpp/src/parquet/encoding_test.cc:769–780  ·  view source on GitHub ↗

Setup encoder/decoder pair for testing with boolean encoding

Source from the content-addressed store, hash-verified

767
768 // Setup encoder/decoder pair for testing with boolean encoding
769 void SetupEncoderDecoder(Encoding::type encoding) {
770 encoder_ = MakeTypedEncoder<BooleanType>(encoding);
771 decoder_ = MakeTypedDecoder<BooleanType>(encoding);
772 const auto* data_ptr = reinterpret_cast<const bool*>(input_data_.data());
773 if (valid_bits_ != nullptr) {
774 ASSERT_NO_THROW(encoder_->PutSpaced(data_ptr, kNumValues, valid_bits_, 0));
775 } else {
776 ASSERT_NO_THROW(encoder_->Put(data_ptr, kNumValues));
777 }
778 buffer_ = encoder_->FlushValues();
779 ResetTheDecoder();
780 }
781
782 void ResetTheDecoder() {
783 ASSERT_NE(nullptr, buffer_);

Callers

nothing calls this directly

Calls 4

dataMethod · 0.45
PutSpacedMethod · 0.45
PutMethod · 0.45
FlushValuesMethod · 0.45

Tested by

no test coverage detected