scalar_column_view.hpp
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
8 
9 namespace CUDF_EXPORT cudf {
10 
27 struct scalar_column_view : private column_view {
33  explicit scalar_column_view(column_view view) : column_view(std::move(view))
34  {
36  this->size() == 1, "A scalar column view must have exactly one element.", std::logic_error);
37  }
38 
39  using column_view::data;
41  using column_view::head;
42  using column_view::is_empty;
44  using column_view::null_mask;
46  using column_view::offset;
47  using column_view::size;
48  using column_view::type;
49 
54  [[nodiscard]] column_view const& as_column_view() const noexcept { return *this; }
55 };
56 
57 } // 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...
column view class definitions
size_type null_count(bitmask_type const *bitmask, size_type start, size_type stop, rmm::cuda_stream_view stream=cudf::get_default_stream())
Given a validity bitmask, counts the number of null elements (unset bits) in the range [start,...
#define CUDF_EXPECTS(...)
Macro for checking (pre-)conditions that throws an exception when a condition is violated.
Definition: error.hpp:143
cuDF interfaces
Definition: host_udf.hpp:26
bool nullable(table_view const &view)
Returns True if any of the columns in the table is nullable. (not entire hierarchy)
bool has_nulls(table_view const &view)
Returns True if the table has nulls in any of its columns.
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
column_view const & as_column_view() const noexcept
Returns a reference to the underlying column_view of this scalar_column_view.
scalar_column_view(column_view view)
Construct a scalar_column_view from a column_view.