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

Function GetColumnParquetInfo

cpp/src/parquet/chunker_internal_test.cc:378–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376using ParquetInfo = std::vector<ColumnInfo>;
377
378ParquetInfo GetColumnParquetInfo(const std::shared_ptr<Buffer>& data, int column_index) {
379 // Read the parquet data out of the buffer and get the sizes and lengths of the
380 // data pages in given column. We assert on the sizes and lengths of the pages
381 // to ensure that the chunking is done correctly.
382 ParquetInfo result;
383
384 auto buffer_reader = std::make_shared<BufferReader>(data);
385 auto parquet_reader = ParquetFileReader::Open(std::move(buffer_reader));
386
387 auto metadata = parquet_reader->metadata();
388 for (int rg = 0; rg < metadata->num_row_groups(); rg++) {
389 auto page_reader = parquet_reader->RowGroup(rg)->GetColumnPageReader(column_index);
390 ColumnInfo column_info;
391 while (auto page = page_reader->NextPage()) {
392 if (page->type() == PageType::DATA_PAGE || page->type() == PageType::DATA_PAGE_V2) {
393 auto data_page = static_cast<DataPage*>(page.get());
394 column_info.page_sizes.push_back(data_page->uncompressed_size());
395 column_info.page_lengths.push_back(data_page->num_values());
396 } else if (page->type() == PageType::DICTIONARY_PAGE) {
397 column_info.has_dictionary_page = true;
398 }
399 }
400 result.push_back(column_info);
401 }
402
403 return result;
404}
405
406// A git-hunk like side-by-side data structure to represent the differences between two
407// vectors of uint64_t values.

Callers 2

TEST_FFunction · 0.85
TEST_PFunction · 0.85

Calls 10

push_backMethod · 0.80
uncompressed_sizeMethod · 0.80
metadataMethod · 0.45
num_row_groupsMethod · 0.45
GetColumnPageReaderMethod · 0.45
RowGroupMethod · 0.45
NextPageMethod · 0.45
typeMethod · 0.45
getMethod · 0.45
num_valuesMethod · 0.45

Tested by

no test coverage detected