Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c93ec2e
first commit of status opt in feature
abigalekim Aug 5, 2026
78bbb90
refactor
abigalekim Aug 5, 2026
11029ea
Update cpp/src/io/parquet/experimental/variant_extract.cu
abigalekim Aug 5, 2026
b6a421d
Update cpp/src/io/parquet/experimental/variant_extract.cu
abigalekim Aug 5, 2026
7f339cf
reviews
abigalekim Aug 5, 2026
3b57150
Merge branch 'main' into ak/variant-status
abigalekim Aug 5, 2026
dd35bee
Merge branch 'main' into ak/variant-status
abigalekim Aug 5, 2026
a41e516
reviews
abigalekim Aug 5, 2026
f018976
removing redundant things & comments
abigalekim Aug 6, 2026
93f2cac
Merge main into ak/variant-status, resolve conflicts
abigalekim Aug 6, 2026
5d22976
combing
abigalekim Aug 6, 2026
2345cd4
comments
abigalekim Aug 6, 2026
2935ba6
stuff
abigalekim Aug 6, 2026
f28e126
extract combing
abigalekim Aug 6, 2026
59769ad
Merge branch 'main' into ak/variant-status
vuule Aug 7, 2026
d901a02
changes
abigalekim Aug 7, 2026
3120d9f
Merge branch 'ak/variant-status' of github.com:abigalekim/cudf into a…
abigalekim Aug 7, 2026
54c720a
changes
abigalekim Aug 8, 2026
d24b074
Merge branch 'main' into ak/variant-status
abigalekim Aug 8, 2026
207742d
reviews
abigalekim Aug 8, 2026
49e7e41
Merge branch 'ak/variant-status' of github.com:abigalekim/cudf into a…
abigalekim Aug 8, 2026
639acc3
addressing comments
abigalekim Aug 8, 2026
3cb0e7f
reviews
abigalekim Aug 8, 2026
d07f24f
changes
abigalekim Aug 11, 2026
f743b73
Merge branch 'main' into ak/variant-status
abigalekim Aug 11, 2026
bcd3083
changes
abigalekim Aug 11, 2026
bd75903
Merge branch 'ak/variant-status' of github.com:abigalekim/cudf into a…
abigalekim Aug 12, 2026
5ca368d
Merge branch 'main' into ak/variant-status
abigalekim Aug 12, 2026
3f316bf
reviews
abigalekim Aug 12, 2026
d00a0c3
Merge branch 'ak/variant-status' of github.com:abigalekim/cudf into a…
abigalekim Aug 12, 2026
ca3d7d5
Merge branch 'main' into ak/variant-status
abigalekim Aug 12, 2026
ee46adc
Merge branch 'main' into ak/variant-status
abigalekim Aug 12, 2026
f2b8a52
reviews
abigalekim Aug 12, 2026
ac26f90
Merge branch 'ak/variant-status' of github.com:abigalekim/cudf into a…
abigalekim Aug 12, 2026
ada04d9
Merge branch 'main' into ak/variant-status
abigalekim Aug 13, 2026
62e3319
Update cpp/src/io/parquet/experimental/variant_extract.cu
abigalekim Aug 14, 2026
7746e8f
Merge branch 'main' into ak/variant-status
abigalekim Aug 14, 2026
c239a0a
fixing comments
abigalekim Aug 14, 2026
41e84ed
Merge branch 'ak/variant-status' of github.com:abigalekim/cudf into a…
abigalekim Aug 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions cpp/include/cudf/io/experimental/variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

#include <cudf/column/column.hpp>
#include <cudf/column/column_view.hpp>
#include <cudf/io/experimental/variant_spec.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/default_stream.hpp>
#include <cudf/utilities/memory_resource.hpp>

#include <rmm/cuda_stream_view.hpp>

#include <memory>
#include <optional>
#include <string_view>

/**
Expand Down Expand Up @@ -48,6 +50,8 @@ namespace io::parquet::experimental {
* @param variant_column Struct column (VARIANT materialization) with `list<uint8>` children
* (`metadata`, `value`), plus optional shredded siblings
* @param path JSONPath-like path string identifying the target field
* @param status_out Optional. When non-null, receives a non-nullable `UINT8` column of
* `variant_operation_status` values, one per row
* @param stream CUDA stream
* @param mr Device memory resource
* @return `list<uint8>` column with the extracted value's encoded bytes. A row is null when the
Expand All @@ -60,8 +64,9 @@ namespace io::parquet::experimental {
[[nodiscard]] std::unique_ptr<column> get_variant_field(
column_view const& variant_column,
std::string_view path,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
std::unique_ptr<column>* status_out = nullptr,

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.

This signature change breaks the existing JNI call sites. Could you update the three calls in VariantUtilsJni.cpp in this PR by passing explicit nullptr arguments for the new status parameters?

get_variant_field(..., nullptr, stream, mr);
cast_variant(..., nullptr, nullptr, stream, mr);
extract_variant_field(..., nullptr, stream, mr);

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 will re-run CI to make sure the code works but I did edit VariantUtilsJni.cpp to reflect this.

rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());

/**
* @brief Decode a VARIANT value column's blobs into a typed cuDF column.
Expand All @@ -72,19 +77,27 @@ namespace io::parquet::experimental {
* @param values `list<uint8>` column of VARIANT-encoded value bytes
* @param desired_type Target cuDF type (`STRING`, `INT8`/`INT16`/`INT32`/`INT64`,
* `FLOAT32`/`FLOAT64`, or `BOOL8`)
* @param incoming_status Optional status column from a prior `get_variant_field` call. When
* provided, non-success rows are propagated directly to the output without decoding.
* Must be non-nullable, `UINT8`, and have the same row count as `values`.
* @param status_out Optional. When non-null, receives a non-nullable `UINT8` column of
* `variant_operation_status` values, one per row
* @param stream CUDA stream
* @param mr Device memory resource
* @return Typed column decoded from the VARIANT value blobs
*
* @throws std::invalid_argument if `values` is not a `list<uint8>` column, or if `desired_type`
* @throws std::invalid_argument if `values` is not a `list<uint8>` column; if `desired_type`
* is not one of the supported types (`STRING`, `INT8`/`INT16`/`INT32`/`INT64`,
* `FLOAT32`/`FLOAT64`, or `BOOL8`)
* `FLOAT32`/`FLOAT64`, or `BOOL8`); or if `incoming_status` is provided but is nullable,
* not `UINT8`, or has a different row count than `values`
Comment thread
coderabbitai[bot] marked this conversation as resolved.
*/
[[nodiscard]] std::unique_ptr<column> cast_variant(
column_view const& values,
data_type desired_type,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
std::optional<column_view> incoming_status = std::nullopt,
std::unique_ptr<column>* status_out = nullptr,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Comment thread
abigalekim marked this conversation as resolved.

/**
* @brief Convenience wrapper: extract a nested object value by path and decode into a typed column.
Expand All @@ -96,6 +109,8 @@ namespace io::parquet::experimental {
* @param path JSONPath-like path string (see `get_variant_field` for syntax)
* @param desired_type Target type: `STRING`, `INT8`/`INT16`/`INT32`/`INT64`,
* `FLOAT32`/`FLOAT64`, or `BOOL8`
* @param status_out Optional. When non-null, receives a non-nullable `UINT8` column of
* `variant_operation_status` values, one per row
* @param stream CUDA stream
* @param mr Device memory resource
* @return Column of `desired_type`
Expand All @@ -106,8 +121,9 @@ namespace io::parquet::experimental {
column_view const& variant_column,
std::string_view path,
data_type desired_type,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
std::unique_ptr<column>* status_out = nullptr,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());

/** @} */
} // namespace io::parquet::experimental
Expand Down
14 changes: 14 additions & 0 deletions cpp/include/cudf/io/experimental/variant_spec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,18 @@ enum class variant_primitive_type : uint8_t {
UUID = 20,
};

/**
* @brief VARIANT status types.
*/
enum class variant_operation_status : uint8_t {
Comment thread
abigalekim marked this conversation as resolved.
SUCCESS = 0, ///< operation completed successfully
ROW_NULL = 1, ///< the SQL row itself was null (no VARIANT data to decode)
MISSING_PATH = 2, ///< the requested path does not exist in the VARIANT
VARIANT_NULL = 3, ///< the value at the path is a VARIANT null
TYPE_MISMATCH = 4, ///< the value's type does not match the requested type
MALFORMED_VARIANT = 5, ///< the VARIANT binary encoding is invalid
OVERFLOW = 6, ///< the value overflows the target numeric type
INVALID_CONVERSION = 7, ///< the value cannot be converted to the requested type
};

} // namespace cudf::io::parquet::experimental
Loading
Loading