Skip to content

Add floating point type support to Parquet variant field extraction - #23075

Merged
rapids-bot[bot] merged 32 commits into
NVIDIA:mainfrom
abigalekim:ak/float-variant
Jul 27, 2026
Merged

Add floating point type support to Parquet variant field extraction#23075
rapids-bot[bot] merged 32 commits into
NVIDIA:mainfrom
abigalekim:ak/float-variant

Conversation

@abigalekim

Copy link
Copy Markdown
Contributor

Description

Adds floating point 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 1, 2026 22:26
@copy-pr-bot

copy-pr-bot Bot commented Jul 1, 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 feature request New feature or request non-breaking Non-breaking change labels Jul 1, 2026
@github-actions github-actions Bot added the libcudf Affects libcudf (C++/CUDA) code. label Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 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

Walkthrough

This PR extends experimental VARIANT casting to support FLOAT32/FLOAT64 primitive types, updates public documentation, broadens unaligned_load constraints, and adds float casting and empty-input tests.

Changes

VARIANT float casting support

Layer / File(s) Summary
Documentation updates for float support
cpp/include/cudf/io/experimental/variant.hpp
Documents FLOAT32/FLOAT64 as supported desired_type values and updates copyright text.
Float decode and cast kernel implementation
cpp/src/io/utilities/block_utils.cuh, cpp/src/io/parquet/experimental/variant_extract.cu
Generalizes primitive VARIANT decoding and casting to floating-point types; unaligned_load accepts trivially copyable types.
Tests for float casting
cpp/tests/io/experimental/variant_extract_test.cpp
Adds float/double casting coverage and expands empty-input checks to FLOAT32/FLOAT64.

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

Possibly related PRs

  • rapidsai/cudf#23069: Adds JNI/Java bindings that call the same experimental VARIANT APIs.
  • rapidsai/cudf#23276: Extends the same VARIANT primitive-casting dispatch and tests for boolean values.

Suggested labels: improvement, tests, doc

Suggested reviewers: gregorykimball, igorpeshansky, simoneves

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed The title accurately summarizes the main change by describing added floating point support for variant field extraction.
Description check ✅ Passed The description is directly related to the changes and correctly states the addition of floating point support.
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.

🧹 Nitpick comments (1)
cpp/src/io/parquet/experimental/variant_extract.cu (1)

578-615: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Kernel/functor duplication between int and float cast paths.

cast_variant_float_kernel and the float operator() in cast_variant_fn are near-identical copies of cast_variant_int_kernel (Line 549) and the int operator() (Line 678), differing only in the decode function invoked (decode_int<T> vs decode_float<T>). Consider a single templated kernel/functor parameterized on the decode function to avoid maintaining two copies of the same launch/null-handling logic going forward.

♻️ Sketch of a unified kernel
-template <typename T>
-CUDF_KERNEL __launch_bounds__(block_size) void cast_variant_int_kernel(
-  cudf::lists_column_device_view values, device_span<T> d_output, bitmask_type* d_null_mask)
-{ ... decode_int<T> ... }
-
-template <typename T>
-CUDF_KERNEL __launch_bounds__(block_size) void cast_variant_float_kernel(
-  cudf::lists_column_device_view values, device_span<T> d_output, bitmask_type* d_null_mask)
-{ ... decode_float<T> ... }
+template <typename T, typename DecodeFn>
+CUDF_KERNEL __launch_bounds__(block_size) void cast_variant_fixed_width_kernel(
+  cudf::lists_column_device_view values, device_span<T> d_output, bitmask_type* d_null_mask,
+  DecodeFn decode)
+{
+  // shared body; calls decode(val) instead of decode_int<T>/decode_float<T>
+}

Also applies to: 698-717

🤖 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/src/io/parquet/experimental/variant_extract.cu` around lines 578 - 615,
The float casting path duplicates the same launch and null-handling logic used
by the int path, so update `cast_variant_float_kernel` and the float
`operator()` in `cast_variant_fn` to share the same implementation as
`cast_variant_int_kernel` and its int functor. Refactor the kernel/functor pair
into a single templated path parameterized by the decode routine (for example,
`decode_int<T>` vs `decode_float<T>`) while preserving the existing row
iteration, null-mask updates, and output assignment behavior.
🤖 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.

Nitpick comments:
In `@cpp/src/io/parquet/experimental/variant_extract.cu`:
- Around line 578-615: The float casting path duplicates the same launch and
null-handling logic used by the int path, so update `cast_variant_float_kernel`
and the float `operator()` in `cast_variant_fn` to share the same implementation
as `cast_variant_int_kernel` and its int functor. Refactor the kernel/functor
pair into a single templated path parameterized by the decode routine (for
example, `decode_int<T>` vs `decode_float<T>`) while preserving the existing row
iteration, null-mask updates, and output assignment behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 654845a8-137a-4729-9b5a-b05e8d420e8c

📥 Commits

Reviewing files that changed from the base of the PR and between ffafbac and 6ff24c5.

📒 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/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
Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated
Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated
Comment on lines 376 to 377
cuda::std::is_same_v<T, int8_t> || cuda::std::is_same_v<T, int16_t> ||
cuda::std::is_same_v<T, int32_t> || cuda::std::is_same_v<T, int64_t>;

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.

Even this could be cudf::is_integral_not_bool<T>() and cudf::is_signed<T>() (pending checking if __int128 is excluded from this)

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.

I don't think int128 is included in support, does this make the check refactorable?

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.

Should cudf::is_signed() include __int128? If so, this check is fragile.

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.

Is is_variant_int being use elsewhere besides computing is_variant_primitive. If not, we can directly compute is_variant_primitive.

Also, yes we can write is_variant_int` as:

template <typename T>
constexpr bool is_variant_int = cudf::is_integral_not_bool<T>() and cudf::is_signed<T>() and not cuda::std::is_same_v<T, __int128_t>();

Not sure if it's any better than the current

Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated
Comment on lines 376 to 377
cuda::std::is_same_v<T, int8_t> || cuda::std::is_same_v<T, int16_t> ||
cuda::std::is_same_v<T, int32_t> || cuda::std::is_same_v<T, int64_t>;

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.

Should cudf::is_signed() include __int128? If so, this check is fragile.

Comment thread cpp/src/io/parquet/experimental/variant_extract.cu Outdated
Comment thread cpp/src/io/utilities/block_utils.cuh Outdated
abigalekim and others added 2 commits July 10, 2026 19:28
Co-authored-by: Vukasin Milovanovic <vmilovanovic@nvidia.com>
@abigalekim
abigalekim requested review from mhaseeb123 and vuule July 13, 2026 16:27
Comment thread cpp/tests/io/experimental/variant_extract_test.cpp Outdated
@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test 9030bda

@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test 07a767d

Comment thread cpp/tests/io/experimental/variant_extract_test.cpp Outdated
Comment thread cpp/tests/io/experimental/variant_extract_test.cpp Outdated
@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test f2efc36

@abigalekim
abigalekim requested a review from ttnghia July 22, 2026 20:59
@abigalekim

Copy link
Copy Markdown
Contributor Author

/ok to test 6ab6fd9

@vuule

vuule commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit b7f6e32 into NVIDIA:main Jul 27, 2026
136 checks passed
@GregoryKimball GregoryKimball moved this from Burndown to Landed in libcudf Jul 30, 2026
@GregoryKimball GregoryKimball removed this from libcudf Aug 21, 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 CMake CMake build issue feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

Status: Landed

Development

Successfully merging this pull request may close these issues.

7 participants