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

Function MakeDictPage

cpp/src/parquet/test_util.h:442–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440
441template <typename Type>
442inline std::shared_ptr<DictionaryPage> MakeDictPage(
443 const ColumnDescriptor* d, const std::vector<typename Type::c_type>& values,
444 const std::vector<int>& values_per_page, Encoding::type encoding,
445 std::vector<std::shared_ptr<Buffer>>& rle_indices) {
446 test::DictionaryPageBuilder<Type> page_builder(d);
447 int num_pages = static_cast<int>(values_per_page.size());
448 int value_start = 0;
449
450 for (int i = 0; i < num_pages; i++) {
451 rle_indices.push_back(page_builder.AppendValues(
452 slice(values, value_start, value_start + values_per_page[i])));
453 value_start += values_per_page[i];
454 }
455
456 auto buffer = page_builder.WriteDict();
457
458 return std::make_shared<DictionaryPage>(buffer, page_builder.num_values(),
459 Encoding::PLAIN);
460}
461
462// Given def/rep levels and values create multiple dict pages
463template <typename Type>

Callers

nothing calls this directly

Calls 6

sliceFunction · 0.85
push_backMethod · 0.80
sizeMethod · 0.45
AppendValuesMethod · 0.45
WriteDictMethod · 0.45
num_valuesMethod · 0.45

Tested by

no test coverage detected