Skip to content

Add page-level I/O and materialization in Hybrid Scan - #23375

Open
mhaseeb123 wants to merge 20 commits into
NVIDIA:mainfrom
mhaseeb123:feature/sparse-page-io-hybrid
Open

Add page-level I/O and materialization in Hybrid Scan#23375
mhaseeb123 wants to merge 20 commits into
NVIDIA:mainfrom
mhaseeb123:feature/sparse-page-io-hybrid

Conversation

@mhaseeb123

@mhaseeb123 mhaseeb123 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Description

Contributes to #23519

This PR adds new hybrid scan APIs to support page-level (sparse) I/O for payload columns. This includes:

  • API to compute (pruned) page-level I/O byte range for payload columns
  • API to only materialize these sparse pages into the output table
  • End-to-end test coverage and some negative tests. More extensive tests will land in Enable page-level payload I/O in hybrid scan #23362

Checklist

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

Preserve page locations and variable-width offset state needed to safely
reconstruct columns from a sparse subset of Parquet data pages.
Expose multifile page-range planning and consume the selected payload pages so
hybrid scan avoids fetching pruned Parquet payload data.
@mhaseeb123
mhaseeb123 requested a review from a team as a code owner July 21, 2026 17:43
@mhaseeb123
mhaseeb123 requested review from mattgara and simoneves and removed request for a team July 21, 2026 17:43
@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Jul 21, 2026
@mhaseeb123
mhaseeb123 marked this pull request as draft July 21, 2026 17:49
@copy-pr-bot

copy-pr-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

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.

rapids-bot Bot pushed a commit that referenced this pull request Jul 24, 2026
Part of #23362

This PR includes bug fixes and supporting features needed to enable page pruning with page-level (sparse) I/O (for payload columns) in hybrid scan, that is upcoming in #23375 and includes end to end tests.

Authors:
  - Muhammad Haseeb (https://github.com/mhaseeb123)

Approvers:
  - Paul Mattione (https://github.com/pmattione-nvidia)
  - Vukasin Milovanovic (https://github.com/vuule)
  - Bradley Dice (https://github.com/bdice)
  - Nghia Truong (https://github.com/ttnghia)

URL: #23374
@mhaseeb123
mhaseeb123 changed the base branch from feature/sparse-page-io-foundation to main July 28, 2026 00:40
@mhaseeb123
mhaseeb123 force-pushed the feature/sparse-page-io-hybrid branch from ce70f6f to 1cf8e93 Compare July 31, 2026 23:26
@mhaseeb123
mhaseeb123 marked this pull request as ready for review July 31, 2026 23:33
@mhaseeb123 mhaseeb123 changed the title Add sparse page I/O to hybrid scan Add page-level (sparse) materializers in Hybrid Scan Jul 31, 2026
@mhaseeb123 mhaseeb123 changed the title Add page-level (sparse) materializers in Hybrid Scan Add page-level I/O and materialization in Hybrid Scan Jul 31, 2026
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added sparse, page-level payload scanning for hybrid multifile Parquet reads.
    • Added row-mask-based page selection and targeted chunking for more efficient filtered reads.
    • Added support for dictionary pages, pruned pages, and chunked multifile scans.
  • Bug Fixes

    • Improved handling of empty buffers, sparse page metadata, dictionary data, and page masks.
    • Added validation for missing offset indexes and inconsistent page data.

Walkthrough

The PR adds payload page-range APIs, sparse page-data chunking, page-level pass masks, sparse Parquet preprocessing, and multifile hybrid-scan coverage for pruning, dictionaries, missing offset indexes, and row-group ordering.

Changes

Sparse payload hybrid scan

Layer / File(s) Summary
Payload range planning
cpp/include/cudf/io/experimental/hybrid_scan_multifile.hpp, cpp/src/io/parquet/experimental/hybrid_scan_helpers.hpp, cpp/src/io/parquet/experimental/hybrid_scan_impl.*, cpp/src/io/parquet/experimental/hybrid_scan_multifile.cpp
Adds flattened payload page ranges, source indices, dictionary-page ranges, offset-index validation, pruned-page representation, and a page-data chunking overload.
Sparse page preprocessing
cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu, cpp/src/io/parquet/reader_impl_preprocess_utils.*, cpp/src/io/parquet/reader_impl.*, cpp/src/io/parquet/io_utils/parquet_io_utils.cpp
Validates sparse page spans, decodes page headers, tracks sparse I/O state, handles sparse dictionary pointers, and safely represents empty device buffers.
Sparse pass chunking and masks
cpp/src/io/parquet/experimental/hybrid_scan_chunking.cu, cpp/src/io/parquet/experimental/hybrid_scan_impl.*, cpp/src/io/parquet/experimental/page_index_filter.cu
Pass setup accepts current data-page masks. Sparse mode initializes page metadata, builds masks from page spans, and accounts for sparse input sizes.
Multifile integration and validation
cpp/tests/io/experimental/hybrid_scan_multifile_composer.*, cpp/tests/io/experimental/hybrid_scan_multifile*_test.cpp
Adds sparse multifile composition and coverage for empty masks, missing offset indexes, dictionary pages, asymmetric row-group ordering, and fully pruned payload data.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested labels: cuIO, improvement

Suggested reviewers: simoneves, mattgara, vuule

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.26% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding page-level I/O and materialization support to Hybrid Scan.
Description check ✅ Passed The description directly explains the page-level sparse I/O APIs, materialization support, and test coverage in the changeset.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.


// Must be called as soon as we create the pass
set_pass_page_mask(data_page_mask);
setup_next_pass(column_chunk_data, data_page_mask);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

set_pass_page_mask is now moved inside the setup_next_pass


// Setup page information for the chunk (which we can access without decompressing)
setup_compressed_data(column_chunk_data);
if (_sparse_page_io) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Use either the dense or sparse overloads of the setup_compressed_data and set_pass_page_mask APIs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The sparse vs dense functions seem on the edge of similarity where it could make sense to use a template parameter and if constexpr instead of having separate functions. I'll defer to your judgment, just a thought.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True for setup_xx_compressed_data but not really for the setup_xx_page_mask. Will defer this to a follow up if the duplicated portion seems to be growing

* @param schema_indices Schema indices from the first source
* @return A pair indicating column-index and offset-index presence, respectively
*/
[[nodiscard]] std::pair<bool, bool> page_index_presence(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Simply moved from private to public scope

@mhaseeb123
mhaseeb123 requested a review from qbacpey August 3, 2026 19:19
rapids-bot Bot pushed a commit that referenced this pull request Aug 4, 2026
Part 1 of 3. Contributes to #23519

This PR improves Parquet reader's pass construction by making it column chunk aware so that it is more accurate (less conservative) when reading select columns from the file. 

Subsequent PRs will propagate these improvements to hybrid scan as well as enable hybrid scan to calculate at page-level (needs #23375)

Authors:
  - Muhammad Haseeb (https://github.com/mhaseeb123)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Qi Chen (https://github.com/qbacpey)

URL: #23446
Comment thread cpp/src/io/parquet/experimental/hybrid_scan_preprocess.cu
Comment thread cpp/src/io/parquet/experimental/hybrid_scan_chunking.cu Outdated
@mhaseeb123
mhaseeb123 requested a review from qbacpey August 7, 2026 21:59
@mhaseeb123
mhaseeb123 removed the request for review from qbacpey August 17, 2026 22:46
@mhaseeb123
mhaseeb123 requested a review from a team as a code owner August 17, 2026 22:47
@mhaseeb123
mhaseeb123 requested a review from qbacpey August 18, 2026 02:38
@mhaseeb123 mhaseeb123 added 4 - Needs Review Waiting for reviewer to review or respond and removed 3 - Ready for Review Ready for review by team labels Aug 18, 2026

@vyasr vyasr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some minor thoughts but nothing blocking, LGTM!


// Setup page information for the chunk (which we can access without decompressing)
setup_compressed_data(column_chunk_data);
if (_sparse_page_io) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The sparse vs dense functions seem on the edge of similarity where it could make sense to use a template parameter and if constexpr instead of having separate functions. I'll defer to your judgment, just a thought.

Comment thread cpp/src/io/parquet/experimental/hybrid_scan_impl.cpp
Comment thread cpp/src/io/parquet/experimental/hybrid_scan_impl.cpp
Comment thread cpp/src/io/parquet/experimental/hybrid_scan_impl.cpp Outdated
@mhaseeb123 mhaseeb123 added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 4 - Needs Review Waiting for reviewer to review or respond labels Aug 19, 2026
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 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.

3 participants