sparrow ..
Loading...
Searching...
No Matches
sparrow::map_array Class Referencefinal

#include <map_array.hpp>

Inheritance diagram for sparrow::map_array:
[legend]
Collaboration diagram for sparrow::map_array:
[legend]

Public Types

using self_type = map_array
 
using base_type = array_bitmap_base<self_type>
 
using inner_types = array_inner_types<self_type>
 
using value_iterator = inner_types::value_iterator
 
using const_value_iterator = inner_types::const_value_iterator
 
using size_type = typename base_type::size_type
 
using offset_type = const std::int32_t
 
using offset_buffer_type = u8_buffer<std::remove_const_t<offset_type>>
 
using bitmap_type = typename base_type::bitmap_type
 
using bitmap_const_reference = typename base_type::bitmap_const_reference
 
using const_bitmap_range = typename base_type::const_bitmap_range
 
using inner_value_type = inner_types::inner_value_type
 
using inner_reference = inner_types::inner_reference
 
using inner_const_reference = inner_types::inner_const_reference
 
using value_type = nullable<inner_value_type>
 
using const_reference = nullable<inner_const_reference, bitmap_const_reference>
 
using iterator_tag = typename base_type::iterator_tag
 
- Public Types inherited from sparrow::array_bitmap_base_impl< D, false >
using base_type
 
using size_type
 
using bitmap_type
 
using bitmap_iterator
 
using const_bitmap_iterator
 
using bitmap_const_reference
 
using difference_type
 
using const_bitmap_range
 
using iterator_tag
 

Public Member Functions

SPARROW_API map_array (arrow_proxy proxy)
 Constructs map array from Arrow proxy.
 
template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<map_array, Args...>)
 map_array (Args &&... args)
 Generic constructor for creating map array from various inputs.
 
SPARROW_API map_array (const self_type &rhs)
 Copy constructor.
 
SPARROW_API map_arrayoperator= (const self_type &rhs)
 Copy assignment operator.
 
 map_array (map_array &&) noexcept=default
 
map_arrayoperator= (map_array &&) noexcept=default
 
SPARROW_API const array_wrapperraw_keys_array () const
 Gets read-only access to the keys array.
 
SPARROW_API array_wrapperraw_keys_array ()
 Gets mutable access to the keys array.
 
SPARROW_API const array_wrapperraw_items_array () const
 Gets read-only access to the values array.
 
SPARROW_API array_wrapperraw_items_array ()
 Gets mutable access to the values array.
 
- Public Member Functions inherited from sparrow::array_bitmap_base_impl< D, false >
constexpr auto insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) -> bitmap_iterator is_mutable
 
constexpr auto insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) -> bitmap_iterator is_mutable
 

Static Public Member Functions

template<std::ranges::range SIZES_RANGE>
static auto offset_from_sizes (SIZES_RANGE &&sizes) -> offset_buffer_type
 Creates offset buffer from map sizes.
 

Friends

class array_crtp_base< map_array >
 
class detail::layout_value_functor< const map_array, map_value >
 

Additional Inherited Members

- Protected Member Functions inherited from sparrow::array_bitmap_base_impl< D, false >
 array_bitmap_base_impl (arrow_proxy proxy)
 Constructs array bitmap base from Arrow proxy.
 
constexpr array_bitmap_base_impl (const array_bitmap_base_impl &)
 Copy constructor.
 
constexpr array_bitmap_base_imploperator= (const array_bitmap_base_impl &)
 Copy assignment operator.
 
constexpr array_bitmap_base_impl (array_bitmap_base_impl &&) noexcept=default
 
constexpr array_bitmap_base_imploperator= (array_bitmap_base_impl &&) noexcept=default
 
constexpr bitmap_typeget_bitmap ()
 Gets mutable reference to the validity bitmap.
 
constexpr const bitmap_typeget_bitmap () const
 Gets const reference to the validity bitmap.
 
constexpr void resize_bitmap (size_type new_length, bool value)
 Resizes the validity bitmap to accommodate new array length.
 
constexpr bitmap_iterator insert_bitmap (const_bitmap_iterator pos, bool value, size_type count)
 Inserts validity bits at specified position.
 
constexpr bitmap_iterator insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) is_mutable
 Inserts range of validity bits at specified position.
 
constexpr bitmap_iterator erase_bitmap (const_bitmap_iterator pos, size_type count)
 Erases validity bits starting at specified position.
 
constexpr void update ()
 Updates internal bitmap after external modifications to Arrow data.
 
constexpr non_owning_dynamic_bitset< uint8_t > get_non_owning_dynamic_bitset ()
 Gets non-owning view of the bitmap as dynamic bitset.
 
constexpr bitmap_type make_bitmap ()
 Creates bitmap wrapper from current Arrow validity buffer.
 
 array_bitmap_base_impl (arrow_proxy proxy)
 Constructs array bitmap base from Arrow proxy.
 
constexpr array_bitmap_base_impl (const array_bitmap_base_impl &)
 Copy constructor.
 
constexpr array_bitmap_base_impl (array_bitmap_base_impl &&) noexcept=default
 
constexpr array_bitmap_base_imploperator= (const array_bitmap_base_impl &)
 Copy assignment operator.
 
constexpr array_bitmap_base_imploperator= (array_bitmap_base_impl &&) noexcept=default
 
constexpr bitmap_typeget_bitmap ()
 Gets mutable reference to the validity bitmap.
 
constexpr const bitmap_typeget_bitmap () const
 Gets const reference to the validity bitmap.
 
constexpr void resize_bitmap (size_type new_length, bool value)
 Resizes the validity bitmap to accommodate new array length.
 
constexpr bitmap_iterator insert_bitmap (const_bitmap_iterator pos, bool value, size_type count)
 Inserts validity bits at specified position.
 
constexpr bitmap_iterator insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) is_mutable
 Inserts range of validity bits at specified position.
 
constexpr bitmap_iterator erase_bitmap (const_bitmap_iterator pos, size_type count)
 Erases validity bits starting at specified position.
 
constexpr void update ()
 Updates internal bitmap after external modifications to Arrow data.
 
constexpr non_owning_dynamic_bitset< uint8_t > get_non_owning_dynamic_bitset ()
 Gets non-owning view of the bitmap as dynamic bitset.
 
constexpr bitmap_type make_bitmap ()
 Creates bitmap wrapper from current Arrow validity buffer.
 

Detailed Description

Definition at line 87 of file map_array.hpp.

Member Typedef Documentation

◆ base_type

◆ bitmap_const_reference

◆ bitmap_type

Definition at line 100 of file map_array.hpp.

◆ const_bitmap_range

◆ const_reference

◆ const_value_iterator

using sparrow::map_array::const_value_iterator = inner_types::const_value_iterator

◆ inner_const_reference

using sparrow::map_array::inner_const_reference = inner_types::inner_const_reference

◆ inner_reference

using sparrow::map_array::inner_reference = inner_types::inner_reference

◆ inner_types

◆ inner_value_type

using sparrow::map_array::inner_value_type = inner_types::inner_value_type

◆ iterator_tag

◆ offset_buffer_type

◆ offset_type

◆ self_type

◆ size_type

Definition at line 96 of file map_array.hpp.

◆ value_iterator

using sparrow::map_array::value_iterator = inner_types::value_iterator

Definition at line 94 of file map_array.hpp.

◆ value_type

Constructor & Destructor Documentation

◆ map_array() [1/4]

SPARROW_API sparrow::map_array::map_array ( arrow_proxy proxy)
explicit

Constructs map array from Arrow proxy.

Parameters
proxyArrow proxy containing map array data and schema
Precondition
proxy must contain valid Arrow Map array and schema
proxy format must be "+m"
proxy must have exactly one child array (struct with key/value fields)
proxy must have offset buffer at index 1
Postcondition
Array is initialized with data from proxy
Keys sorted flag is extracted from Arrow flags
Offset pointers and child arrays are set up for efficient access
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/map_array.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_array() [2/4]

template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<map_array, Args...>)
sparrow::map_array::map_array ( Args &&... args)
inlineexplicit

Generic constructor for creating map array from various inputs.

Creates a map array from different input combinations. Arguments are forwarded to compatible create_proxy() functions based on their types.

Template Parameters
ArgsParameter pack for constructor arguments
Parameters
argsConstructor arguments (keys, values, offsets, validity, metadata, etc.)
Precondition
Arguments must match one of the create_proxy() overload signatures
Keys and values arrays must have compatible sizes with offsets
All offsets must be within bounds of the key/value arrays
Postcondition
Array is created with the specified data and configuration
Keys sorted flag is determined from key ordering within each map

Definition at line 145 of file map_array.hpp.

◆ map_array() [3/4]

SPARROW_API sparrow::map_array::map_array ( const self_type & rhs)

Copy constructor.

Parameters
rhsSource array to copy from
Precondition
rhs must be in a valid state
Postcondition
This array contains a deep copy of rhs data
Child arrays and offset pointers are reconstructed

◆ map_array() [4/4]

sparrow::map_array::map_array ( map_array && )
defaultnoexcept
Here is the call graph for this function:

Member Function Documentation

◆ offset_from_sizes()

template<std::ranges::range SIZES_RANGE>
auto sparrow::map_array::offset_from_sizes ( SIZES_RANGE && sizes) -> offset_buffer_type
staticnodiscard

Creates offset buffer from map sizes.

Converts a range of map sizes (number of key-value pairs per map) into cumulative offsets. The resulting offset buffer has size = sizes.size() + 1, with the first element being 0 and subsequent elements being cumulative sums.

Template Parameters
SIZES_RANGEType of input range containing map sizes
Parameters
sizesRange of map sizes (number of pairs per map)
Returns
Offset buffer suitable for map array construction
Precondition
sizes must be a valid range of non-negative integers
All sizes must fit within the offset_type (int32_t) range
Postcondition
Returned buffer has size = sizes.size() + 1
First offset is 0, last offset is sum of all sizes
Each offset[i+1] = offset[i] + sizes[i]
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/map_array.hpp.

Definition at line 514 of file map_array.hpp.

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

◆ operator=() [1/2]

SPARROW_API map_array & sparrow::map_array::operator= ( const self_type & rhs)

Copy assignment operator.

Parameters
rhsSource array to copy from
Returns
Reference to this array
Precondition
rhs must be in a valid state
Postcondition
This array contains a deep copy of rhs data
Previous data is properly released
Child arrays and offset pointers are reconstructed
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/map_array.hpp.
Here is the call graph for this function:

◆ operator=() [2/2]

map_array & sparrow::map_array::operator= ( map_array && )
defaultnoexcept
Here is the call graph for this function:

◆ raw_items_array() [1/2]

SPARROW_API array_wrapper * sparrow::map_array::raw_items_array ( )
nodiscard

Gets mutable access to the values array.

Returns
Pointer to the flat values array
Postcondition
Returns non-null pointer to valid array_wrapper containing all values
Here is the call graph for this function:

◆ raw_items_array() [2/2]

SPARROW_API const array_wrapper * sparrow::map_array::raw_items_array ( ) const
nodiscard

Gets read-only access to the values array.

Returns
Const pointer to the flat values array
Postcondition
Returns non-null pointer to valid array_wrapper containing all values
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/map_array.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ raw_keys_array() [1/2]

SPARROW_API array_wrapper * sparrow::map_array::raw_keys_array ( )
nodiscard

Gets mutable access to the keys array.

Returns
Pointer to the flat keys array
Postcondition
Returns non-null pointer to valid array_wrapper containing all keys
Here is the call graph for this function:

◆ raw_keys_array() [2/2]

SPARROW_API const array_wrapper * sparrow::map_array::raw_keys_array ( ) const
nodiscard

Gets read-only access to the keys array.

Returns
Const pointer to the flat keys array
Postcondition
Returns non-null pointer to valid array_wrapper containing all keys
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/map_array.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ array_crtp_base< map_array >

friend class array_crtp_base< map_array >
friend

Definition at line 506 of file map_array.hpp.

◆ detail::layout_value_functor< const map_array, map_value >

friend class detail::layout_value_functor< const map_array, map_value >
friend

Definition at line 506 of file map_array.hpp.


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