dictionary_column_view.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020-2022, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include <cudf/column/column.hpp>
20 
26 namespace cudf {
41  public:
47  dictionary_column_view(column_view const& dictionary_column);
50  ~dictionary_column_view() = default;
51 
58 
65 
67  static constexpr size_type indices_column_index{0};
69  static constexpr size_type keys_column_index{1};
70 
75  using column_view::offset;
76  using column_view::size;
77 
83  [[nodiscard]] column_view parent() const noexcept;
84 
90  [[nodiscard]] column_view indices() const noexcept;
91 
98  [[nodiscard]] column_view get_indices_annotated() const noexcept;
99 
105  [[nodiscard]] column_view keys() const noexcept;
106 
112  [[nodiscard]] data_type keys_type() const noexcept;
113 
119  [[nodiscard]] size_type keys_size() const noexcept;
120 }; // end of group
122 
124 namespace dictionary { // defined here for doxygen output
125 }
126 
127 } // namespace cudf
cudf::dictionary_column_view::operator=
dictionary_column_view & operator=(dictionary_column_view const &)=default
Move assignment operator.
cudf::dictionary_column_view::indices_column_index
static constexpr size_type indices_column_index
Index of the indices column of the dictionary column.
Definition: dictionary_column_view.hpp:67
cudf::dictionary_column_view::parent
column_view parent() const noexcept
Returns the parent column.
cudf::size_type
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:80
column.hpp
Class definition for cudf::column.
cudf::column_view
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
Definition: column_view.hpp:322
cudf::detail::column_view_base::offset
size_type offset() const noexcept
Returns the index of the first element relative to the base memory allocation, i.e....
Definition: column_view.hpp:230
cudf::dictionary_column_view::indices
column_view indices() const noexcept
Returns the column of indices.
cudf::dictionary_column_view::dictionary_column_view
dictionary_column_view(dictionary_column_view const &)=default
Copy constructor.
cudf::dictionary_column_view::keys
column_view keys() const noexcept
Returns the column of keys.
cudf::dictionary_column_view
A wrapper class for operations on a dictionary column.
Definition: dictionary_column_view.hpp:40
cudf::dictionary_column_view::dictionary_column_view
dictionary_column_view(dictionary_column_view &&)=default
Move constructor.
cudf::detail::column_view_base::null_count
size_type null_count() const
Returns the count of null elements.
cudf::data_type
Indicator for the logical data type of an element in a column.
Definition: types.hpp:236
cudf::detail::column_view_base::has_nulls
bool has_nulls() const
Indicates if the column contains null elements, i.e., null_count() > 0
Definition: column_view.hpp:195
cudf
cuDF interfaces
Definition: aggregation.hpp:34
cudf::dictionary_column_view::keys_type
data_type keys_type() const noexcept
Returns the cudf::data_type of the keys child column.
cudf::dictionary_column_view::keys_size
size_type keys_size() const noexcept
Returns the number of rows in the keys column.
cudf::dictionary_column_view::keys_column_index
static constexpr size_type keys_column_index
Index of the keys column of the dictionary column.
Definition: dictionary_column_view.hpp:69
cudf::detail::column_view_base::size
size_type size() const noexcept
Returns the number of elements in the column.
Definition: column_view.hpp:133
cudf::dictionary_column_view::operator=
dictionary_column_view & operator=(dictionary_column_view &&)=default
Copy assignment operator.
column_view.hpp
column view class definitions
cudf::detail::column_view_base::is_empty
bool is_empty() const noexcept
Returns true if size() returns zero, or false otherwise.
Definition: column_view.hpp:140
cudf::dictionary_column_view::get_indices_annotated
column_view get_indices_annotated() const noexcept
Returns a column_view combining the indices data with offset, size, and nulls from the parent.
cudf::detail::column_view_base::null_mask
bitmask_type const * null_mask() const noexcept
Returns raw pointer to the underlying bitmask allocation.
Definition: column_view.hpp:222
cudf::dictionary_column_view::dictionary_column_view
dictionary_column_view(column_view const &dictionary_column)
Construct a new dictionary column view object from a column view.