Public Member Functions | List of all members
cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT > Class Template Reference

column_wrapper derived class for wrapping dictionary columns. More...

#include <column_wrapper.hpp>

Inheritance diagram for cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT >:
cudf::test::detail::column_wrapper

Public Member Functions

 operator dictionary_column_view () const
 Cast to dictionary_column_view.
 
 dictionary_column_wrapper ()
 Default constructor initializes an empty column with dictionary type.
 
template<typename InputIterator >
 dictionary_column_wrapper (InputIterator begin, InputIterator end)
 Construct a non-nullable dictionary column of the fixed-width elements in the range [begin,end). More...
 
template<typename InputIterator , typename ValidityIterator >
 dictionary_column_wrapper (InputIterator begin, InputIterator end, ValidityIterator v)
 Construct a nullable dictionary column of the fixed-width elements in the range [begin,end) using the range [v, v + distance(begin,end)) interpreted as booleans to indicate the validity of each element. More...
 
template<typename ElementFrom >
 dictionary_column_wrapper (std::initializer_list< ElementFrom > elements)
 Construct a non-nullable dictionary column of fixed-width elements from an initializer list. More...
 
template<typename ElementFrom >
 dictionary_column_wrapper (std::initializer_list< ElementFrom > elements, std::initializer_list< bool > validity)
 Construct a nullable dictionary column from a list of fixed-width elements using another list to indicate the validity of each element. More...
 
template<typename ValidityIterator , typename ElementFrom >
 dictionary_column_wrapper (std::initializer_list< ElementFrom > element_list, ValidityIterator v)
 Construct a nullable dictionary column from a list of fixed-width elements and the range [v, v + element_list.size()) interpreted as booleans to indicate the validity of each element. More...
 
template<typename InputIterator >
 dictionary_column_wrapper (InputIterator begin, InputIterator end, std::initializer_list< bool > const &validity)
 Construct a nullable dictionary column of the fixed-width elements in the range [begin,end) using a validity initializer list to indicate the validity of each element. More...
 
- Public Member Functions inherited from cudf::test::detail::column_wrapper
 operator column_view () const
 Implicit conversion operator to column_view. More...
 
 operator mutable_column_view ()
 Implicit conversion operator to mutable_column_view. More...
 
std::unique_ptr< cudf::columnrelease ()
 Releases internal unique_ptr to wrapped column. More...
 

Additional Inherited Members

- Protected Attributes inherited from cudf::test::detail::column_wrapper
std::unique_ptr< cudf::columnwrapped {}
 The wrapped column.
 

Detailed Description

template<typename KeyElementTo, typename SourceElementT = KeyElementTo>
class cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT >

column_wrapper derived class for wrapping dictionary columns.

This class handles fixed-width type keys.

Template Parameters
KeyElementToSpecify a fixed-width type for the key values of the dictionary
SourceElementToFor converting fixed-width values to the KeyElementTo

Definition at line 938 of file column_wrapper.hpp.

Constructor & Destructor Documentation

◆ dictionary_column_wrapper() [1/6]

template<typename KeyElementTo , typename SourceElementT = KeyElementTo>
template<typename InputIterator >
cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT >::dictionary_column_wrapper ( InputIterator  begin,
InputIterator  end 
)
inline

Construct a non-nullable dictionary column of the fixed-width elements in the range [begin,end).

Example:

// Creates a non-nullable dictionary column of INT32 elements with 5 elements
std::vector<int32_t> elements{0, 2, 2, 6, 6};
dictionary_column_wrapper<int32_t> w(element.begin(), elements.end());
// keys = {0, 2, 6}, indices = {0, 1, 1, 2, 2}
Note
Similar to std::vector, this "range" constructor should be used with parentheses () and not braces {}. The latter should only be used for the initializer_list constructors.
Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements

Definition at line 973 of file column_wrapper.hpp.

◆ dictionary_column_wrapper() [2/6]

template<typename KeyElementTo , typename SourceElementT = KeyElementTo>
template<typename InputIterator , typename ValidityIterator >
cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT >::dictionary_column_wrapper ( InputIterator  begin,
InputIterator  end,
ValidityIterator  v 
)
inline

Construct a nullable dictionary column of the fixed-width elements in the range [begin,end) using the range [v, v + distance(begin,end)) interpreted as booleans to indicate the validity of each element.

If v[i] == true, element i is valid, else it is null.

Example:

// Creates a nullable dictionary column with 5 elements and a validity iterator.
std::vector<int32_t> elements{0, 2, 0, 6, 0};
// Validity iterator here sets even rows to null.
auto validity = make_counting_transform_iterator(0, [](auto i){return i%2;})
dictionary_column_wrapper<int32_t> w(elements, elements + 5, validity);
// keys = {2, 6}, indices = {NULL, 0, NULL, 1, NULL}
Note
Similar to std::vector, this "range" constructor should be used with parentheses () and not braces {}. The latter should only be used for the initializer_list constructors.
Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements
vThe beginning of the sequence of validity indicators

Definition at line 1007 of file column_wrapper.hpp.

◆ dictionary_column_wrapper() [3/6]

template<typename KeyElementTo , typename SourceElementT = KeyElementTo>
template<typename ElementFrom >
cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT >::dictionary_column_wrapper ( std::initializer_list< ElementFrom >  elements)
inline

Construct a non-nullable dictionary column of fixed-width elements from an initializer list.

Example:

// Creates a non-nullable dictionary column with 4 elements.
dictionary_column_wrapper<int32_t> w{{1, 2, 3, 1}};
// keys = {1, 2, 3}, indices = {0, 1, 2, 0}
Parameters
elementsThe list of elements

Definition at line 1030 of file column_wrapper.hpp.

◆ dictionary_column_wrapper() [4/6]

template<typename KeyElementTo , typename SourceElementT = KeyElementTo>
template<typename ElementFrom >
cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT >::dictionary_column_wrapper ( std::initializer_list< ElementFrom >  elements,
std::initializer_list< bool >  validity 
)
inline

Construct a nullable dictionary column from a list of fixed-width elements using another list to indicate the validity of each element.

The validity of each element is determined by an initializer_list of booleans where true indicates the element is valid, and false indicates the element is null.

Example:

// Creates a nullable dictionary column with 4 elements and validity initializer.
dictionary_column_wrapper<int32_t> w{ {1, 0, 3, 0}, {1, 0, 1, 0}};
// keys = {1, 3}, indices = {0, NULL, 1, NULL}
Parameters
elementsThe list of elements
validityThe list of validity indicator booleans

Definition at line 1054 of file column_wrapper.hpp.

◆ dictionary_column_wrapper() [5/6]

template<typename KeyElementTo , typename SourceElementT = KeyElementTo>
template<typename ValidityIterator , typename ElementFrom >
cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT >::dictionary_column_wrapper ( std::initializer_list< ElementFrom >  element_list,
ValidityIterator  v 
)
inline

Construct a nullable dictionary column from a list of fixed-width elements and the range [v, v + element_list.size()) interpreted as booleans to indicate the validity of each element.

Example:

// Creates a nullable dictionary column with 6 elements and a validity iterator.
// This validity iterator sets even rows to null.
auto validity = make_counting_transform_iterator(0, [](auto i){return i%2;})
dictionary_column_wrapper<int32_t> w{ {0, 4, 0, 4, 0, 5}, validity}
// keys = {4, 5}, indices = {NULL, 0, NULL, 0, NULL, 1}
Template Parameters
ValidityIteratorDereferencing a ValidityIterator must be convertible to bool
Parameters
element_listThe list of elements
vThe beginning of the sequence of validity indicators

Definition at line 1079 of file column_wrapper.hpp.

◆ dictionary_column_wrapper() [6/6]

template<typename KeyElementTo , typename SourceElementT = KeyElementTo>
template<typename InputIterator >
cudf::test::dictionary_column_wrapper< KeyElementTo, SourceElementT >::dictionary_column_wrapper ( InputIterator  begin,
InputIterator  end,
std::initializer_list< bool > const &  validity 
)
inline

Construct a nullable dictionary column of the fixed-width elements in the range [begin,end) using a validity initializer list to indicate the validity of each element.

The validity of each element is determined by an initializer_list of booleans where true indicates the element is valid, and false indicates the element is null.

Example:

// Creates a nullable column of dictionary elements with 5 elements and validity initializer.
std::vector<int32_t> elements{0, 2, 2, 6, 6};
dictionary_width_column_wrapper<int32_t> w(elements, elements + 5, {0, 1, 0, 1, 0});
// keys = {2, 6}, indices = {NULL, 0, NULL, 1, NULL}
Parameters
beginThe beginning of the sequence of elements
endThe end of the sequence of elements
validityThe list of validity indicator booleans

Definition at line 1105 of file column_wrapper.hpp.


The documentation for this class was generated from the following file: