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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 - In Progress Currently a work in progress 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.

1 participant