Skip to content

Add boolean type support to Parquet variant field extraction - #23276

Merged
rapids-bot[bot] merged 20 commits into
NVIDIA:mainfrom
abigalekim:ak/bool-variant
Aug 5, 2026
Merged

Add boolean type support to Parquet variant field extraction#23276
rapids-bot[bot] merged 20 commits into
NVIDIA:mainfrom
abigalekim:ak/bool-variant

Conversation

@abigalekim

Copy link
Copy Markdown
Contributor

Description

Adds boolean type support to Apache Parquet variant field extraction.

Checklist

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

@abigalekim
abigalekim requested a review from a team as a code owner July 15, 2026 19:14
@abigalekim
abigalekim requested review from qbacpey and vyasr July 15, 2026 19:14
@copy-pr-bot

copy-pr-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@abigalekim abigalekim added the feature request New feature or request label Jul 15, 2026
@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Jul 15, 2026
@abigalekim abigalekim added non-breaking Non-breaking change libcudf Affects libcudf (C++/CUDA) code. and removed libcudf Affects libcudf (C++/CUDA) code. labels Jul 15, 2026
@abigalekim
abigalekim requested a review from vuule July 15, 2026 19:16
@coderabbitai

coderabbitai Bot commented Jul 15, 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 support for casting VARIANT boolean values to BOOL8, including correct decoding of true/false and proper handling of sliced multi-row inputs.
  • Documentation
    • Updated VARIANT cast/extract documentation to list BOOL8 as a supported target/destination type and clarified desired_type/throwing behavior.
  • Bug Fixes
    • Malformed or internally inconsistent VARIANT data now yields null results (instead of throwing), including during boolean handling.
  • Tests
    • Expanded and refactored VARIANT cast/extract tests to generate payloads programmatically, added BOOL8 casting coverage, and added cases for malformed inputs and unsupported cast targets.

Walkthrough

VARIANT casting now supports Apache boolean primitives as BOOL8 output. CUDA decoding and null-mask handling were updated, documentation was expanded, and tests cover boolean values, nulls, slices, malformed inputs, cast matrices, and boundary cases.

Changes

VARIANT boolean casting

Layer / File(s) Summary
VARIANT type contract alignment
cpp/include/cudf/io/experimental/variant.hpp, cpp/src/io/parquet/experimental/variant_extract.cu
BOOL8 is documented and accepted as a VARIANT cast target.
Boolean decoding and output construction
cpp/src/io/parquet/experimental/variant_extract.cu
Boolean VARIANT primitives are decoded, row spans use a shared helper, and valid values plus null masks are materialized as BOOL8 output.
Boolean cast validation
cpp/tests/io/experimental/variant_extract_test.cpp
Encoding helpers and tests cover boolean, float, malformed, boundary, matrix, sliced, null, unsupported-target, and empty-input cases.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • rapidsai/cudf#23036: Touches the VARIANT extraction implementation and test suite around basic and primitive type decoding.
  • rapidsai/cudf#23069: Adds Java bindings that dispatch to the affected VARIANT extraction and casting APIs.
  • rapidsai/cudf#23075: Modifies the VARIANT primitive casting implementation and predicate logic.

Suggested labels: tests, cuIO, improvement, 3 - Ready for Review

Suggested reviewers: vyasr, mhaseeb123, qbacpey

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding boolean support to Parquet VARIANT field extraction.
Description check ✅ Passed The description is directly related to the changeset and accurately describes the boolean support update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/tests/io/experimental/variant_extract_test.cpp`:
- Around line 661-675: Add BOOL8 test coverage in
CastVariantTest.ApachePrimitiveBooleans for a null boolean input and a sliced
multi-row input. Reuse the existing cast_variant path and column comparison
pattern, ensuring expected validity masks and values verify null handling and
grid-stride processing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 27916a08-ddf7-4798-b096-5e8d9d69216f

📥 Commits

Reviewing files that changed from the base of the PR and between af9ac19 and 64ea909.

📒 Files selected for processing (3)
  • cpp/include/cudf/io/experimental/variant.hpp
  • cpp/src/io/parquet/experimental/variant_extract.cu
  • cpp/tests/io/experimental/variant_extract_test.cpp

Comment thread cpp/tests/io/experimental/variant_extract_test.cpp
@vuule

vuule commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

There's a lot of conflicting changes between this PR and #23075. Let's merge that one before moving on with this one.

@abigalekim
abigalekim marked this pull request as ready for review July 28, 2026 20:37
@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test 97845f5

@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test b730c80

@abigalekim
abigalekim requested a review from mhaseeb123 July 28, 2026 22:59

@vuule vuule left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

few small suggestions

Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated
Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated
Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cpp/tests/io/experimental/variant_extract_test.cpp (1)

976-1045: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add a multi-block BOOL8 cast case.

The sliced multi-row test does not exercise cast_variant_bool_kernel beyond one 256-thread block. Add at least block_size + 1 rows, including true, false, and null values, and validate the output mask after casting. As per coding guidelines, “Tests must cover empty inputs, nulls, sliced columns, boundary and multi-block sizes.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/tests/io/experimental/variant_extract_test.cpp` around lines 976 - 1045,
Extend the sliced multi-row case in ApachePrimitiveBooleans so the input
contains more than one cast_variant_bool_kernel block, using at least 257 rows
while retaining true, false, and null patterns. Keep the non-zero slice offset
and update expected values and validity to match the enlarged range, then assert
the cast output including its null mask.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@cpp/tests/io/experimental/variant_extract_test.cpp`:
- Around line 976-1045: Extend the sliced multi-row case in
ApachePrimitiveBooleans so the input contains more than one
cast_variant_bool_kernel block, using at least 257 rows while retaining true,
false, and null patterns. Keep the non-zero slice offset and update expected
values and validity to match the enlarged range, then assert the cast output
including its null mask.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1c5d8712-ca0f-4a60-b19d-7ba73349bf85

📥 Commits

Reviewing files that changed from the base of the PR and between b730c80 and 0bab85c.

📒 Files selected for processing (2)
  • cpp/src/io/parquet/experimental/variant_extract.cu
  • cpp/tests/io/experimental/variant_extract_test.cpp

@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test 69bd1d0

Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated
@abigalekim
abigalekim requested a review from mhaseeb123 August 4, 2026 19:10
@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test 98040d5

@mhaseeb123 mhaseeb123 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.

Please take care of one more comment. LGTM otherwise

Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated
@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test 5dd9e23

@PointKernel

Copy link
Copy Markdown
Member

/merge

@rapids-bot
rapids-bot Bot merged commit 079ebcb into NVIDIA:main Aug 5, 2026
138 of 139 checks passed
@abigalekim
abigalekim deleted the ak/bool-variant branch August 5, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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