Skip to content

Conversation

mhaseeb123
Copy link
Member

@mhaseeb123 mhaseeb123 commented Sep 26, 2025

Description

This PR adds a new libcudf example called parquet_inspect which extracts useful row group and page level metadata information from the input parquet file's footer and page index (if available) and writes it to respective new parquet files.

At the row group level, the written file contains three columns containing starting row offset, row counts and byte offset within the file for each row group

At the page-level, the written file contains three columns per input column (column in the input file) containing lists of page-level row offsets, lists of page-level row counts, and lists of page-level byte offsets within the file, one list per row group.

Note that the page-level metadata is only extracted and written if the page index is available in the parquet file.

Checklist

  • I am familiar with the Contributing Guidelines.
  • N/A: New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mhaseeb123 mhaseeb123 requested review from a team as code owners September 26, 2025 00:00
@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Sep 26, 2025
@mhaseeb123 mhaseeb123 changed the title Add parquet inspect example Add an example to inspect parquet files and dump row group and page level metadata information Sep 26, 2025
* @brief Compute page row counts and page row offsets and column chunk page (count) offsets for a
* given column index
*/
[[nodiscard]] auto compute_page_row_counts_and_offsets(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function modified from page_index_filter.cu


cudf::host_span<uint8_t const> fetch_footer_bytes(cudf::host_span<uint8_t const> buffer)
{
CUDF_FUNC_RANGE();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fetch_xx functions copied as-is from hybrid_scan_common.cpp

page_index_bytes.size());
}

std::tuple<cudf::io::parquet::FileMetaData, bool> read_parquet_metadata(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function modified from hybrid_scan_common.cpp

return std::tuple{reader->parquet_metadata(), has_page_index};
}

void write_rowgroup_metadata(cudf::io::parquet::FileMetaData const& metadata,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function modified from hybrid_scan_helpers.cpp and reader_impl_helpers.cpp

@mhaseeb123 mhaseeb123 added feature request New feature or request 2 - In Progress Currently a work in progress cuIO cuIO issue non-breaking Non-breaking change labels Sep 26, 2025
@mhaseeb123 mhaseeb123 marked this pull request as draft September 26, 2025 03:11
Copy link

copy-pr-bot bot commented Sep 26, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@mhaseeb123 mhaseeb123 marked this pull request as ready for review September 30, 2025 21:30
@mhaseeb123 mhaseeb123 added 3 - Ready for Review Ready for review by team and removed 2 - In Progress Currently a work in progress labels Sep 30, 2025
Copy link
Contributor

@vuule vuule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few small comments

@mhaseeb123 mhaseeb123 requested a review from vuule September 30, 2025 22:15
@mhaseeb123 mhaseeb123 requested a review from a team as a code owner September 30, 2025 23:46
@mhaseeb123 mhaseeb123 requested a review from gforsyth September 30, 2025 23:46
@@ -0,0 +1,422 @@
/*
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the code in this file has been modified from libcudf internals

@@ -0,0 +1,42 @@
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified from the CMakeLists.txt in parquet_io example

@mhaseeb123 mhaseeb123 added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Oct 1, 2025
@mhaseeb123
Copy link
Member Author

/merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge CMake CMake build issue cuIO cuIO issue feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants