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

Function GetDictDecoder

cpp/src/parquet/encoding_test.cc:879–902  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877
878template <typename T>
879void GetDictDecoder(DictEncoder<T>* encoder, int64_t num_values,
880 std::shared_ptr<Buffer>* out_values,
881 std::shared_ptr<Buffer>* out_dict, const ColumnDescriptor* descr,
882 std::unique_ptr<TypedDecoder<T>>* out_decoder) {
883 auto decoder = MakeDictDecoder<T>(descr);
884 auto buf = encoder->FlushValues();
885 auto dict_buf = AllocateBuffer(default_memory_pool(), encoder->dict_encoded_size());
886 encoder->WriteDict(dict_buf->mutable_data());
887
888 auto dict_decoder = MakeTypedDecoder<T>(Encoding::PLAIN, descr);
889 dict_decoder->SetData(encoder->num_entries(), dict_buf->data(),
890 static_cast<int>(dict_buf->size()));
891
892 decoder->SetData(static_cast<int>(num_values), buf->data(),
893 static_cast<int>(buf->size()));
894 decoder->SetDict(dict_decoder.get());
895
896 *out_values = buf;
897 *out_dict = dict_buf;
898 ASSERT_NE(decoder, nullptr);
899 auto released = dynamic_cast<TypedDecoder<T>*>(decoder.release());
900 ASSERT_NE(released, nullptr);
901 *out_decoder = std::unique_ptr<TypedDecoder<T>>(released);
902}
903
904template <typename ParquetType>
905class EncodingAdHocTyped : public ::testing::Test {

Callers 3

DictMethod · 0.85
DictPutIndicesMethod · 0.85
TESTFunction · 0.85

Calls 13

default_memory_poolFunction · 0.85
dict_encoded_sizeMethod · 0.80
num_entriesMethod · 0.80
SetDictMethod · 0.80
AllocateBufferFunction · 0.70
FlushValuesMethod · 0.45
WriteDictMethod · 0.45
mutable_dataMethod · 0.45
SetDataMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected