variant.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include <cudf/column/column.hpp>
10 #include <cudf/io/experimental/variant_spec.hpp>
11 #include <cudf/types.hpp>
14 
15 #include <cuda/stream>
16 
17 #include <memory>
18 #include <optional>
19 #include <string_view>
20 
26 namespace CUDF_EXPORT cudf {
27 namespace io::parquet::experimental {
67 [[nodiscard]] std::unique_ptr<column> get_variant_field(
68  column_view const& variant_column,
69  std::string_view path,
70  std::optional<mutable_column_view> status = std::nullopt,
71  cuda::stream_ref stream = cudf::get_default_stream(),
73 
102 [[nodiscard]] std::unique_ptr<column> cast_variant(
103  column_view const& values,
104  data_type desired_type,
105  std::optional<mutable_column_view> status = std::nullopt,
106  cuda::stream_ref stream = cudf::get_default_stream(),
108 
130 [[nodiscard]] std::unique_ptr<column> extract_variant_field(
131  column_view const& variant_column,
132  std::string_view path,
133  data_type desired_type,
134  std::optional<mutable_column_view> status = std::nullopt,
135  cuda::stream_ref stream = cudf::get_default_stream(),
137 
153 [[nodiscard]] std::unique_ptr<column> get_variant_type_id(
154  column_view const& values,
155  cuda::stream_ref stream = cudf::get_default_stream(),
157 
159 } // namespace io::parquet::experimental
160 } // namespace CUDF_EXPORT cudf
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Indicator for the logical data type of an element in a column.
Definition: types.hpp:279
Class definition for cudf::column.
column view class definitions
APIs for querying the default CUDA stream and per-thread default stream status.
cuda::stream_ref const get_default_stream()
Get the current default stream.
std::unique_ptr< column > extract_variant_field(column_view const &variant_column, std::string_view path, data_type desired_type, std::optional< mutable_column_view > status=std::nullopt, cuda::stream_ref stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Convenience wrapper: extract a nested object value by path and decode into a typed column.
std::unique_ptr< column > get_variant_field(column_view const &variant_column, std::string_view path, std::optional< mutable_column_view > status=std::nullopt, cuda::stream_ref stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Extract the raw VARIANT-encoded bytes of a nested field by JSONPath-like path.
std::unique_ptr< column > cast_variant(column_view const &values, data_type desired_type, std::optional< mutable_column_view > status=std::nullopt, cuda::stream_ref stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Decode a VARIANT value column's blobs into a typed cuDF column.
std::unique_ptr< column > get_variant_type_id(column_view const &values, cuda::stream_ref stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Return the logical type of each VARIANT value blob in a list<uint8> column.
rmm::device_async_resource_ref get_current_device_resource_ref()
Get the current device memory resource reference.
cuda::mr::resource_ref< cuda::mr::device_accessible > device_async_resource_ref
APIs for getting and setting the current device memory resource.
cuDF interfaces
Definition: host_udf.hpp:27
Type declarations for libcudf.