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
18 #include <cudf/column/column.hpp>
26 namespace cudf {
41  public:
47  dictionary_column_view(column_view const& dictionary_column);
50  ~dictionary_column_view() = default;
67  static constexpr size_type indices_column_index{0};
69  static constexpr size_type keys_column_index{1};
75  using column_view::offset;
76  using column_view::size;
83  [[nodiscard]] column_view parent() const noexcept;
90  [[nodiscard]] column_view indices() const noexcept;
98  [[nodiscard]] column_view get_indices_annotated() const noexcept;
105  [[nodiscard]] column_view keys() const noexcept;
112  [[nodiscard]] data_type keys_type() const noexcept;
119  [[nodiscard]] size_type keys_size() const noexcept;
120 }; // end of group
124 namespace dictionary { // defined here for doxygen output
125 }
127 } // namespace 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:227
size_type null_count() const
Returns the count of null elements.
size_type size() const noexcept
Returns the number of elements in the column.
size_type offset() const noexcept
Returns the index of the first element relative to the base memory allocation, i.e....
bool has_nulls() const
Indicates if the column contains null elements, i.e., null_count() > 0
bitmask_type const * null_mask() const noexcept
Returns raw pointer to the underlying bitmask allocation.
bool is_empty() const noexcept
Returns true if size() returns zero, or false otherwise.
A wrapper class for operations on a dictionary column.
dictionary_column_view(dictionary_column_view &&)=default
Move constructor.
dictionary_column_view & operator=(dictionary_column_view const &)=default
Move assignment operator.
column_view indices() const noexcept
Returns the column of indices.
dictionary_column_view(dictionary_column_view const &)=default
Copy constructor.
static constexpr size_type keys_column_index
Index of the keys column of the dictionary column.
column_view keys() const noexcept
Returns the column of keys.
dictionary_column_view(column_view const &dictionary_column)
Construct a new dictionary column view object from a column view.
size_type keys_size() const noexcept
Returns the number of rows in the keys column.
data_type keys_type() const noexcept
Returns the cudf::data_type of the keys child column.
dictionary_column_view & operator=(dictionary_column_view &&)=default
Copy assignment operator.
column_view get_indices_annotated() const noexcept
Returns a column_view combining the indices data with offset, size, and nulls from the parent.
column_view parent() const noexcept
Returns the parent column.
static constexpr size_type indices_column_index
Index of the indices column of the dictionary column.
Class definition for cudf::column.
column view class definitions
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:80
cuDF interfaces
Definition: aggregation.hpp:34