sparrow ..
Loading...
Searching...
No Matches
sparrow::dictionary_encoded_array< IT > Class Template Reference

Forward declaration of dictionary_encoded_array. More...

#include <dictionary_encoded_array.hpp>

Public Types

using self_type = dictionary_encoded_array<IT>
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
using inner_value_type = array_traits::inner_value_type
 
using value_type = array_traits::value_type
 
using reference = array_traits::const_reference
 
using const_reference = array_traits::const_reference
 
using functor_type = layout_element_functor<self_type, true>
 
using const_functor_type = layout_element_functor<self_type, true>
 
using iterator = functor_index_iterator<functor_type>
 
using reverse_iterator = std::reverse_iterator<iterator>
 
using const_iterator = functor_index_iterator<const_functor_type>
 
using const_reverse_iterator = std::reverse_iterator<const_iterator>
 
using keys_buffer_type = u8_buffer<IT>
 

Public Member Functions

 dictionary_encoded_array (arrow_proxy proxy)
 Constructs a dictionary encoded array from an arrow proxy.
 
constexpr dictionary_encoded_array (const self_type &other)
 Copy constructor.
 
constexpr self_typeoperator= (const self_type &other)
 Copy assignment operator.
 
constexpr dictionary_encoded_array (self_type &&other)
 Move constructor.
 
constexpr self_typeoperator= (self_type &&other)
 Move assignment operator.
 
constexpr std::optional< std::string_view > name () const
 Gets the name of the array.
 
std::optional< key_value_viewmetadata () const
 Gets the metadata of the array.
 
constexpr size_type size () const
 Gets the number of elements in the array.
 
constexpr bool empty () const
 Checks if the array is empty.
 
SPARROW_CONSTEXPR_CLANG const_reference operator[] (size_type i) const
 Access operator for getting element at index.
 
constexpr iterator begin ()
 Gets an iterator to the beginning of the array.
 
constexpr iterator end ()
 Gets an iterator to the end of the array.
 
constexpr const_iterator begin () const
 Gets a constant iterator to the beginning of the array.
 
constexpr const_iterator end () const
 Gets a constant iterator to the end of the array.
 
constexpr const_iterator cbegin () const
 Gets a constant iterator to the beginning of the array.
 
constexpr const_iterator cend () const
 Gets a constant iterator to the end of the array.
 
constexpr reverse_iterator rbegin ()
 Gets a reverse iterator to the beginning of the array.
 
constexpr reverse_iterator rend ()
 Gets a reverse iterator to the end of the array.
 
constexpr const_reverse_iterator rbegin () const
 Gets a constant reverse iterator to the beginning of the array.
 
constexpr const_reverse_iterator rend () const
 Gets a constant reverse iterator to the end of the array.
 
constexpr const_reverse_iterator crbegin () const
 Gets a constant reverse iterator to the beginning of the array.
 
constexpr const_reverse_iterator crend () const
 Gets a constant reverse iterator to the end of the array.
 
SPARROW_CONSTEXPR_CLANG const_reference front () const
 Gets a reference to the first element.
 
SPARROW_CONSTEXPR_CLANG const_reference back () const
 Gets a reference to the last element.
 
template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<dictionary_encoded_array<IT>, Args...>)
 dictionary_encoded_array (Args &&... args)
 Constructs a dictionary encoded array with the given arguments.
 
constexpr self_type slice (size_type start, size_type end) const
 Slices the array to keep only the elements between the given start and end.
 
constexpr self_type slice_view (size_type start, size_type end) const
 Slices the array to keep only the elements between the given start and end.
 
template<validity_bitmap_input VBI, input_metadata_container METADATA_RANGE>
auto create_proxy (keys_buffer_type &&keys, array &&values, VBI &&validity_input, std::optional< std::string_view > name, std::optional< METADATA_RANGE > metadata) -> arrow_proxy
 
template<input_metadata_container METADATA_RANGE>
arrow_proxy create_proxy_impl (keys_buffer_type &&keys, array &&values, std::optional< validity_bitmap > validity, std::optional< std::string_view > name, std::optional< METADATA_RANGE > metadata)
 

Friends

class detail::array_access
 

Detailed Description

template<std::integral IT>
class sparrow::dictionary_encoded_array< IT >

Forward declaration of dictionary_encoded_array.

Dictionary encoded array class.

Template Parameters
ITThe integral type used for dictionary keys.

Dictionary encoding is a data representation technique to represent values by integers referencing a dictionary usually consisting of unique values. It can be effective when you have data with many repeated values. Related Apache Arrow specification: https://arrow.apache.org/docs/dev/format/Columnar.html#dictionary-encoded-layout

Template Parameters
ITThe integral type used for dictionary keys.

Definition at line 149 of file dictionary_encoded_array.hpp.

Member Typedef Documentation

◆ const_functor_type

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::const_functor_type = layout_element_functor<self_type, true>

Definition at line 164 of file dictionary_encoded_array.hpp.

◆ const_iterator

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::const_iterator = functor_index_iterator<const_functor_type>

Definition at line 168 of file dictionary_encoded_array.hpp.

◆ const_reference

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::const_reference = array_traits::const_reference

Definition at line 161 of file dictionary_encoded_array.hpp.

◆ const_reverse_iterator

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 169 of file dictionary_encoded_array.hpp.

◆ difference_type

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::difference_type = std::ptrdiff_t

Definition at line 155 of file dictionary_encoded_array.hpp.

◆ functor_type

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::functor_type = layout_element_functor<self_type, true>

Definition at line 163 of file dictionary_encoded_array.hpp.

◆ inner_value_type

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::inner_value_type = array_traits::inner_value_type

Definition at line 157 of file dictionary_encoded_array.hpp.

◆ iterator

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::iterator = functor_index_iterator<functor_type>

Definition at line 166 of file dictionary_encoded_array.hpp.

◆ keys_buffer_type

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::keys_buffer_type = u8_buffer<IT>

Definition at line 171 of file dictionary_encoded_array.hpp.

◆ reference

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::reference = array_traits::const_reference

Definition at line 160 of file dictionary_encoded_array.hpp.

◆ reverse_iterator

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 167 of file dictionary_encoded_array.hpp.

◆ self_type

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::self_type = dictionary_encoded_array<IT>

Definition at line 153 of file dictionary_encoded_array.hpp.

◆ size_type

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::size_type = std::size_t

Definition at line 154 of file dictionary_encoded_array.hpp.

◆ value_type

template<std::integral IT>
using sparrow::dictionary_encoded_array< IT >::value_type = array_traits::value_type

Definition at line 159 of file dictionary_encoded_array.hpp.

Constructor & Destructor Documentation

◆ dictionary_encoded_array() [1/4]

template<std::integral IT>
sparrow::dictionary_encoded_array< IT >::dictionary_encoded_array ( arrow_proxy proxy)
explicit

Constructs a dictionary encoded array from an arrow proxy.

Parameters
proxyThe arrow proxy containing the array data and schema.

Definition at line 580 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ dictionary_encoded_array() [2/4]

template<std::integral IT>
sparrow::dictionary_encoded_array< IT >::dictionary_encoded_array ( const self_type & other)
constexpr

Copy constructor.

Parameters
otherThe dictionary_encoded_array to copy from.

Definition at line 589 of file dictionary_encoded_array.hpp.

◆ dictionary_encoded_array() [3/4]

template<std::integral IT>
sparrow::dictionary_encoded_array< IT >::dictionary_encoded_array ( self_type && other)
constexpr

Move constructor.

Parameters
otherThe dictionary_encoded_array to move from.

Definition at line 609 of file dictionary_encoded_array.hpp.

◆ dictionary_encoded_array() [4/4]

template<std::integral IT>
template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<dictionary_encoded_array<IT>, Args...>)
sparrow::dictionary_encoded_array< IT >::dictionary_encoded_array ( Args &&... args)
inlineexplicit

Constructs a dictionary encoded array with the given arguments.

Template Parameters
ArgsThe argument types.
Parameters
argsArguments forwarded to create_proxy.

Definition at line 352 of file dictionary_encoded_array.hpp.

Member Function Documentation

◆ back()

template<std::integral IT>
SPARROW_CONSTEXPR_CLANG auto sparrow::dictionary_encoded_array< IT >::back ( ) const
nodiscard

Gets a reference to the last element.

Returns
Constant reference to the last element.

Definition at line 875 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ begin() [1/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::begin ( )
nodiscardconstexpr

Gets an iterator to the beginning of the array.

Returns
Iterator to the beginning.

Definition at line 796 of file dictionary_encoded_array.hpp.

Here is the caller graph for this function:

◆ begin() [2/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::begin ( ) const
nodiscardconstexpr

Gets a constant iterator to the beginning of the array.

Returns
Constant iterator to the beginning.

Definition at line 808 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ cbegin()

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::cbegin ( ) const
nodiscardconstexpr

Gets a constant iterator to the beginning of the array.

Returns
Constant iterator to the beginning.

Definition at line 820 of file dictionary_encoded_array.hpp.

Here is the caller graph for this function:

◆ cend()

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::cend ( ) const
nodiscardconstexpr

Gets a constant iterator to the end of the array.

Returns
Constant iterator to the end.

Definition at line 826 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ crbegin()

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::crbegin ( ) const
nodiscardconstexpr

Gets a constant reverse iterator to the beginning of the array.

Returns
Constant reverse iterator to the beginning.

Definition at line 856 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ create_proxy()

template<std::integral IT>
template<validity_bitmap_input VBI, input_metadata_container METADATA_RANGE>
auto sparrow::dictionary_encoded_array< IT >::create_proxy ( keys_buffer_type && keys,
array && values,
VBI && validity_input,
std::optional< std::string_view > name,
std::optional< METADATA_RANGE > metadata ) -> arrow_proxy

Definition at line 631 of file dictionary_encoded_array.hpp.

◆ create_proxy_impl()

template<std::integral IT>
template<input_metadata_container METADATA_RANGE>
arrow_proxy sparrow::dictionary_encoded_array< IT >::create_proxy_impl ( keys_buffer_type && keys,
array && values,
std::optional< validity_bitmap > validity,
std::optional< std::string_view > name,
std::optional< METADATA_RANGE > metadata )
nodiscard

Definition at line 672 of file dictionary_encoded_array.hpp.

◆ crend()

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::crend ( ) const
nodiscardconstexpr

Gets a constant reverse iterator to the end of the array.

Returns
Constant reverse iterator to the end.

Definition at line 862 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ empty()

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::empty ( ) const
nodiscardconstexpr

Checks if the array is empty.

Returns
true if the array is empty, false otherwise.

Definition at line 773 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [1/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::end ( )
nodiscardconstexpr

Gets an iterator to the end of the array.

Returns
Iterator to the end.

Definition at line 802 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [2/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::end ( ) const
nodiscardconstexpr

Gets a constant iterator to the end of the array.

Returns
Constant iterator to the end.

Definition at line 814 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ front()

template<std::integral IT>
SPARROW_CONSTEXPR_CLANG auto sparrow::dictionary_encoded_array< IT >::front ( ) const
nodiscard

Gets a reference to the first element.

Returns
Constant reference to the first element.

Definition at line 868 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ metadata()

template<std::integral IT>
std::optional< key_value_view > sparrow::dictionary_encoded_array< IT >::metadata ( ) const
nodiscard

Gets the metadata of the array.

Returns
Optional metadata of the array.

Definition at line 761 of file dictionary_encoded_array.hpp.

◆ name()

template<std::integral IT>
std::optional< std::string_view > sparrow::dictionary_encoded_array< IT >::name ( ) const
nodiscardconstexpr

Gets the name of the array.

Returns
Optional name of the array.

Definition at line 755 of file dictionary_encoded_array.hpp.

◆ operator=() [1/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::operator= ( const self_type & other)
constexpr

Copy assignment operator.

Parameters
otherThe dictionary_encoded_array to copy from.
Returns
Reference to this dictionary_encoded_array.

Definition at line 597 of file dictionary_encoded_array.hpp.

◆ operator=() [2/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::operator= ( self_type && other)
constexpr

Move assignment operator.

Parameters
otherThe dictionary_encoded_array to move from.
Returns
Reference to this dictionary_encoded_array.

Definition at line 617 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ operator[]()

template<std::integral IT>
SPARROW_CONSTEXPR_CLANG auto sparrow::dictionary_encoded_array< IT >::operator[] ( size_type i) const
nodiscard

Access operator for getting element at index.

Parameters
iThe index of the element to access.
Returns
Constant reference to the element at the specified index.

Definition at line 779 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rbegin() [1/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::rbegin ( )
nodiscardconstexpr

Gets a reverse iterator to the beginning of the array.

Returns
Reverse iterator to the beginning.

Definition at line 832 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rbegin() [2/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::rbegin ( ) const
nodiscardconstexpr

Gets a constant reverse iterator to the beginning of the array.

Returns
Constant reverse iterator to the beginning.

Definition at line 844 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ rend() [1/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::rend ( )
nodiscardconstexpr

Gets a reverse iterator to the end of the array.

Returns
Reverse iterator to the end.

Definition at line 838 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rend() [2/2]

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::rend ( ) const
nodiscardconstexpr

Gets a constant reverse iterator to the end of the array.

Returns
Constant reverse iterator to the end.

Definition at line 850 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ size()

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::size ( ) const
nodiscardconstexpr

Gets the number of elements in the array.

Returns
The number of elements.

Definition at line 767 of file dictionary_encoded_array.hpp.

Here is the caller graph for this function:

◆ slice()

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::slice ( size_type start,
size_type end ) const
nodiscardconstexpr

Slices the array to keep only the elements between the given start and end.

A copy of the Array is modified. The data is not modified, only the ArrowArray.offset and ArrowArray.length are updated. If end is greater than the size of the buffers, the following elements will be invalid.

Parameters
startThe index of the first element to keep. Must be less than end.
endThe index of the first element to discard. Must be less than the size of the buffers.

Definition at line 889 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

◆ slice_view()

template<std::integral IT>
auto sparrow::dictionary_encoded_array< IT >::slice_view ( size_type start,
size_type end ) const
nodiscardconstexpr

Slices the array to keep only the elements between the given start and end.

A view of the Array is returned. The data is not modified, only the ArrowArray.offset and ArrowArray.length are updated. If end is greater than the size of the buffers, the following elements will be invalid.

Parameters
startThe index of the first element to keep. Must be less than end.
endThe index of the first element to discard. Must be less than the size of the buffers.

Definition at line 896 of file dictionary_encoded_array.hpp.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ detail::array_access

template<std::integral IT>
friend class detail::array_access
friend

Definition at line 561 of file dictionary_encoded_array.hpp.


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