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

Function EncodeDict

cpp/src/parquet/encoding_benchmark.cc:1061–1080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1059
1060template <typename Type>
1061static void EncodeDict(const std::vector<typename Type::c_type>& values,
1062 benchmark::State& state) {
1063 using T = typename Type::c_type;
1064 int num_values = static_cast<int>(values.size());
1065
1066 MemoryPool* allocator = default_memory_pool();
1067 std::shared_ptr<ColumnDescriptor> descr = Int64Schema(Repetition::REQUIRED);
1068
1069 auto base_encoder = MakeEncoder(Type::type_num, Encoding::RLE_DICTIONARY,
1070 /*use_dictionary=*/true, descr.get(), allocator);
1071 auto encoder =
1072 dynamic_cast<typename EncodingTraits<Type>::Encoder*>(base_encoder.get());
1073 for (auto _ : state) {
1074 encoder->Put(values.data(), num_values);
1075 encoder->FlushValues();
1076 }
1077
1078 state.SetBytesProcessed(state.iterations() * num_values * sizeof(T));
1079 state.SetItemsProcessed(state.iterations() * num_values);
1080}
1081
1082template <typename Type>
1083static void DecodeDict(const std::vector<typename Type::c_type>& values,

Callers

nothing calls this directly

Calls 8

default_memory_poolFunction · 0.85
MakeEncoderFunction · 0.85
Int64SchemaFunction · 0.70
sizeMethod · 0.45
getMethod · 0.45
PutMethod · 0.45
dataMethod · 0.45
FlushValuesMethod · 0.45

Tested by

no test coverage detected