lists_column_view.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2020-2024, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 
7 #include <cudf/column/column.hpp>
9 #include <cudf/utilities/export.hpp>
10 
11 #include <rmm/cuda_stream_view.hpp>
12 
18 namespace CUDF_EXPORT cudf {
19 
29 class lists_column_view : private column_view {
30  public:
31  lists_column_view() = default;
37  lists_column_view(column_view const& lists_column);
40  ~lists_column_view() override = default;
53 
54  static constexpr size_type offsets_column_index{0};
55  static constexpr size_type child_column_index{1};
56 
57  using column_view::child_begin;
58  using column_view::child_end;
60  using column_view::is_empty;
62  using column_view::null_mask;
63  using column_view::offset;
64  using column_view::size;
65  using offset_iterator = size_type const*;
66 
72  [[nodiscard]] column_view parent() const;
73 
80  [[nodiscard]] column_view offsets() const;
81 
88  [[nodiscard]] column_view child() const;
89 
103 
109  [[nodiscard]] offset_iterator offsets_begin() const noexcept
110  {
111  return offsets().begin<size_type>() + offset();
112  }
113 
124  [[nodiscard]] offset_iterator offsets_end() const noexcept
125  {
126  return offsets_begin() + size() + 1;
127  }
128 }; // end of group
130 } // 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...
Given a column-view of lists type, an instance of this class provides a wrapper on this compound colu...
column_view offsets() const
Returns the internal column of offsets.
lists_column_view & operator=(lists_column_view const &)=default
Copy assignment operator.
lists_column_view & operator=(lists_column_view &&)=default
Move assignment operator.
offset_iterator offsets_begin() const noexcept
Return first offset (accounting for column offset)
column_view get_sliced_child(rmm::cuda_stream_view stream) const
Returns the internal child column, applying any offset from the root.
lists_column_view(lists_column_view const &)=default
Copy constructor.
lists_column_view(column_view const &lists_column)
Construct a new lists column view object from a column view.
size_type const * offset_iterator
Iterator type for offsets.
column_view child() const
Returns the internal child column.
lists_column_view(lists_column_view &&)=default
Move constructor.
offset_iterator offsets_end() const noexcept
Return pointer to the position that is one past the last offset.
column_view parent() const
Returns the parent column.
Class definition for cudf::column.
column view class definitions
cudf::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,...
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:84
cuDF interfaces
Definition: host_udf.hpp:26
bool has_nulls(table_view const &view)
Returns True if the table has nulls in any of its columns.