sparrow 0.9.0
Loading...
Searching...
No Matches
sparrow::arrow_proxy Class Reference

#include <arrow_array_schema_proxy.hpp>

Public Member Functions

SPARROW_API arrow_proxy (ArrowArray &&array, ArrowSchema &&schema)
 Constructs an arrow_proxy taking ownership of both ArrowArray and ArrowSchema.
 
SPARROW_API arrow_proxy (ArrowArray &&array, ArrowSchema *schema)
 Constructs an arrow_proxy taking ownership of ArrowArray, referencing ArrowSchema.
 
SPARROW_API arrow_proxy (ArrowArray *array, ArrowSchema *schema)
 Constructs an arrow_proxy referencing external ArrowArray and ArrowSchema.
 
SPARROW_API arrow_proxy (const arrow_proxy &other)
 Copy constructor creating independent copy.
 
SPARROW_API arrow_proxyoperator= (const arrow_proxy &other)
 Copy assignment operator.
 
SPARROW_API arrow_proxy (arrow_proxy &&other) noexcept
 Move constructor transferring ownership.
 
SPARROW_API arrow_proxyoperator= (arrow_proxy &&other) noexcept
 Move assignment operator.
 
SPARROW_API ~arrow_proxy ()
 Destructor releasing owned Arrow structures.
 
SPARROW_API const std::string_view format () const
 Gets the Arrow format string describing the data type.
 
SPARROW_API void set_format (const std::string_view format)
 Sets the Arrow format string.
 
SPARROW_API enum data_type data_type () const
 Gets the data type enum corresponding to the format.
 
void SPARROW_API set_data_type (enum data_type data_type)
 Sets the data type (updates format string accordingly).
 
SPARROW_API std::optional< std::string_view > name () const
 Gets the optional name of the array/field.
 
SPARROW_API void set_name (std::optional< std::string_view > name)
 Sets the name of the array/field.
 
SPARROW_API std::optional< key_value_viewmetadata () const
 Gets the metadata key-value pairs.
 
template<input_metadata_container R>
void set_metadata (std::optional< R > metadata)
 Sets the metadata key-value pairs.
 
SPARROW_API std::unordered_set< ArrowFlagflags () const
 Gets the Arrow flags set for this array.
 
SPARROW_API void set_flags (const std::unordered_set< ArrowFlag > &flags)
 Sets the Arrow flags for this array.
 
SPARROW_API size_t length () const
 Gets the number of elements in the array.
 
SPARROW_API void set_length (size_t length)
 Sets the number of elements in the array.
 
SPARROW_API int64_t null_count () const
 Gets the number of null values in the array.
 
SPARROW_API void set_null_count (int64_t null_count)
 Sets the number of null values in the array.
 
SPARROW_API size_t offset () const
 Gets the starting offset within the buffers.
 
SPARROW_API void set_offset (size_t offset)
 Sets the starting offset within the buffers.
 
SPARROW_API size_t n_buffers () const
 Gets the number of buffers in the array.
 
SPARROW_API void set_n_buffers (size_t n_buffers)
 Sets the number of buffers and resizes the buffer vector.
 
SPARROW_API size_t n_children () const
 Gets the number of child arrays.
 
SPARROW_API const std::vector< sparrow::buffer_view< uint8_t > > & buffers () const
 Gets const reference to the buffer views.
 
SPARROW_API std::vector< sparrow::buffer_view< uint8_t > > & buffers ()
 Gets mutable reference to the buffer views.
 
SPARROW_API void set_buffer (size_t index, const buffer_view< uint8_t > &buffer)
 Sets a specific buffer at the given index.
 
SPARROW_API void set_buffer (size_t index, buffer< uint8_t > &&buffer)
 Sets a specific buffer by moving it at the given index.
 
SPARROW_API void resize_bitmap (size_t new_size, bool value=true)
 Resizes the validity bitmap buffer.
 
SPARROW_API size_t insert_bitmap (size_t index, bool value, size_t count=1)
 Inserts validity bits with the same value at specified position.
 
template<std::ranges::input_range R>
size_t insert_bitmap (size_t index, const R &range)
 Inserts a range of validity bits at specified position.
 
SPARROW_API size_t erase_bitmap (size_t index, size_t count=1)
 Erases validity bits starting at specified position.
 
SPARROW_API void push_back_bitmap (bool value)
 Appends a validity bit at the end of the bitmap.
 
SPARROW_API void pop_back_bitmap ()
 Removes the last validity bit from the bitmap.
 
template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, arrow_array_and_schema_pointers>
void add_children (const R &arrow_array_and_schema_pointers)
 Add children without taking their ownership.
 
template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, arrow_array_and_schema>
void add_children (R &&arrow_array_and_schemas)
 Add children and take their ownership.
 
SPARROW_API void add_child (ArrowArray *array, ArrowSchema *schema)
 Add a child without taking its ownership.
 
SPARROW_API void add_child (ArrowArray &&array, ArrowSchema &&schema)
 Add a child and takes its ownership.
 
SPARROW_API void pop_children (size_t n)
 Pop n children.
 
SPARROW_API void set_child (size_t index, ArrowArray *array, ArrowSchema *schema)
 Set the child at the given index.
 
SPARROW_API void set_child (size_t index, ArrowArray &&array, ArrowSchema &&schema)
 Set the child at the given index.
 
SPARROW_API const std::vector< arrow_proxy > & children () const
 Returns a constant reference to the vector of child arrow proxies.
 
SPARROW_API std::vector< arrow_proxy > & children ()
 Returns a mutable reference to the vector of child arrow proxies.
 
SPARROW_API const std::unique_ptr< arrow_proxy > & dictionary () const
 Returns a constant reference to the dictionary arrow proxy.
 
SPARROW_API std::unique_ptr< arrow_proxy > & dictionary ()
 Returns a mutable reference to the dictionary arrow proxy.
 
SPARROW_API void set_dictionary (ArrowArray *array, ArrowSchema *schema)
 Set the dictionary.It does not take the ownership on the ArrowArray and ArrowSchema passed by pointers.
 
SPARROW_API void set_dictionary (ArrowArray &&array_dictionary, ArrowSchema &&schema_dictionary)
 Set the dictionary.
 
SPARROW_API bool is_created_with_sparrow () const
 Check if the ArrowArray and ArrowSchema were created with sparrow.
 
SPARROW_API void * private_data () const
 
SPARROW_API arrow_proxy view () const
 Get a non-owning view of the arrow_proxy.
 
SPARROW_API bool owns_array () const
 Check whether the proxy has ownership of its internal the ArrowArray.
 
SPARROW_API ArrowArray extract_array ()
 Extract the ArrowArray from the proxy, and transfers the responsibility to release it after usage to the caller.
 
SPARROW_API ArrowArrayarray ()
 Get a reference to the ArrowArray of the proxy.
 
SPARROW_API const ArrowArrayarray () const
 Get a const reference to the ArrowArray of the proxy.
 
SPARROW_API bool owns_schema () const
 Check whether the proxy has ownership of its internal the ArrowSchema.
 
SPARROW_API ArrowSchema extract_schema ()
 Extract the ArrowSchema from the proxy, and transfers the responsibility to release it after usage to the caller.
 
SPARROW_API ArrowSchemaschema ()
 Get a reference to the ArrowSchema of the proxy.
 
SPARROW_API const ArrowSchemaschema () const
 Get a const reference to the ArrowSchema of the proxy.
 
SPARROW_API arrow_schema_private_dataget_schema_private_data ()
 
SPARROW_API arrow_array_private_dataget_array_private_data ()
 
SPARROW_API arrow_proxy slice (size_t start, size_t end) const
 Slices the array to keep only the elements between the given start and end.
 
SPARROW_API arrow_proxy slice_view (size_t start, size_t end) const
 Slices the array to keep only the elements between the given start and end.
 
SPARROW_API void update_buffers ()
 Refresh the buffers views.
 

Detailed Description

Constructor & Destructor Documentation

◆ arrow_proxy() [1/5]

SPARROW_API sparrow::arrow_proxy::arrow_proxy ( ArrowArray && array,
ArrowSchema && schema )
explicit

Constructs an arrow_proxy taking ownership of both ArrowArray and ArrowSchema.

Parameters
arrayArrowArray to take ownership of
schemaArrowSchema to take ownership of
Precondition
array and schema must be valid Arrow structures
array and schema must be compatible (matching data types)
Postcondition
This proxy owns both structures and will release them on destruction
Buffers, children, and dictionary are properly initialized
Internal consistency is validated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arrow_proxy() [2/5]

SPARROW_API sparrow::arrow_proxy::arrow_proxy ( ArrowArray && array,
ArrowSchema * schema )
explicit

Constructs an arrow_proxy taking ownership of ArrowArray, referencing ArrowSchema.

Parameters
arrayArrowArray to take ownership of
schemaPointer to ArrowSchema (not owned)
Precondition
array must be a valid Arrow structure
schema must be a valid pointer to ArrowSchema
array and schema must be compatible
Postcondition
This proxy owns the array but not the schema
Schema must remain valid for the lifetime of this proxy
Buffers and children are properly initialized
Here is the call graph for this function:

◆ arrow_proxy() [3/5]

SPARROW_API sparrow::arrow_proxy::arrow_proxy ( ArrowArray * array,
ArrowSchema * schema )
explicit

Constructs an arrow_proxy referencing external ArrowArray and ArrowSchema.

Parameters
arrayPointer to ArrowArray (not owned)
schemaPointer to ArrowSchema (not owned)
Precondition
array must be a valid pointer to ArrowArray
schema must be a valid pointer to ArrowSchema
array and schema must be compatible
External structures must remain valid for the lifetime of this proxy
Postcondition
This proxy does not own either structure
External structures must be managed by the caller
Buffers and children are properly initialized as views
Here is the call graph for this function:

◆ arrow_proxy() [4/5]

SPARROW_API sparrow::arrow_proxy::arrow_proxy ( const arrow_proxy & other)

Copy constructor creating independent copy.

Parameters
otherSource arrow_proxy to copy from
Precondition
other must be in a valid state
Postcondition
This proxy is an independent copy of other
If other owns structures, this proxy owns copies
If other references external structures, this proxy references the same
Deep copy of all children and dictionary (if owned)
Here is the call graph for this function:

◆ arrow_proxy() [5/5]

SPARROW_API sparrow::arrow_proxy::arrow_proxy ( arrow_proxy && other)
noexcept

Move constructor transferring ownership.

Parameters
otherSource arrow_proxy to move from
Precondition
other must be in a valid state
Postcondition
This proxy takes ownership from other
other is left in a valid but unspecified state
No copying of Arrow structures occurs
Here is the call graph for this function:

◆ ~arrow_proxy()

SPARROW_API sparrow::arrow_proxy::~arrow_proxy ( )

Destructor releasing owned Arrow structures.

Postcondition
All owned Arrow structures are properly released
Referenced external structures are not affected
Children and dictionary are recursively released (if owned)
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

Member Function Documentation

◆ add_child() [1/2]

SPARROW_API void sparrow::arrow_proxy::add_child ( ArrowArray && array,
ArrowSchema && schema )

Add a child and takes its ownership.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` or the `ArrowSchema` wrapped in this proxy were not created with sparrow.
Parameters
arrayThe ArrowArray to set as child.
schemaThe ArrowSchema to set as child.
Here is the call graph for this function:

◆ add_child() [2/2]

SPARROW_API void sparrow::arrow_proxy::add_child ( ArrowArray * array,
ArrowSchema * schema )

Add a child without taking its ownership.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` or the `ArrowSchema` wrapped in this proxy were not created with sparrow.
Parameters
arrayThe ArrowArray to set as child.
schemaThe ArrowSchema to set as child.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ add_children() [1/2]

template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, arrow_array_and_schema_pointers>
void sparrow::arrow_proxy::add_children ( const R & arrow_array_and_schema_pointers)

Add children without taking their ownership.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` or the `ArrowSchema` wrapped in this proxy were not created with sparrow.
Parameters
arrow_array_and_schema_pointersThe children to add.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

Definition at line 947 of file arrow_array_schema_proxy.hpp.

Here is the call graph for this function:

◆ add_children() [2/2]

template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, arrow_array_and_schema>
void sparrow::arrow_proxy::add_children ( R && arrow_array_and_schemas)

Add children and take their ownership.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` or the `ArrowSchema` wrapped in this proxy were not created with sparrow.
Parameters
arrow_array_and_schemasThe children to add.

Definition at line 971 of file arrow_array_schema_proxy.hpp.

Here is the call graph for this function:

◆ array() [1/2]

SPARROW_API ArrowArray & sparrow::arrow_proxy::array ( )
nodiscard

Get a reference to the ArrowArray of the proxy.

The proxy is still reponsible for releasing it, and the reference returned from this method should not outlive the proxy.

The schema flags can be updated by adding sparrow::ArrowFlag::NULLABLE, if null_count is greater than 0.

Returns
The ArrowArray.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ array() [2/2]

SPARROW_API const ArrowArray & sparrow::arrow_proxy::array ( ) const
nodiscard

Get a const reference to the ArrowArray of the proxy.

The proxy is still reponsible for releasing it, and the reference returned from this method should not outlive the proxy.

The schema flags can be updated by adding sparrow::ArrowFlag::NULLABLE, if null_count is greater than 0.

Returns
The ArrowArray const reference.

◆ buffers() [1/2]

SPARROW_API std::vector< sparrow::buffer_view< uint8_t > > & sparrow::arrow_proxy::buffers ( )
nodiscard

Gets mutable reference to the buffer views.

Returns
Mutable reference to vector of buffer views
Postcondition
Buffer views can be modified through the returned reference
Changes to buffers may require calling update_buffers()
Buffer modifications should maintain data type consistency

◆ buffers() [2/2]

SPARROW_API const std::vector< sparrow::buffer_view< uint8_t > > & sparrow::arrow_proxy::buffers ( ) const
nodiscard

Gets const reference to the buffer views.

Returns
Const reference to vector of buffer views
Postcondition
Buffer views remain valid while proxy exists
Number of buffers matches n_buffers()
Buffer sizes are consistent with array length and offset
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ children() [1/2]

SPARROW_API std::vector< arrow_proxy > & sparrow::arrow_proxy::children ( )
nodiscard

Returns a mutable reference to the vector of child arrow proxies.

This method provides read-write access to the collection of child arrow proxies associated with this arrow array schema proxy. The children represent nested or structured data elements within the schema.

Returns
std::vector<arrow_proxy>& A mutable reference to the vector containing the child arrow proxies.

◆ children() [2/2]

SPARROW_API const std::vector< arrow_proxy > & sparrow::arrow_proxy::children ( ) const
nodiscard

Returns a constant reference to the vector of child arrow proxies.

This method provides read-only access to the collection of child arrow proxies associated with this arrow array schema proxy. The children represent nested or structured data elements within the schema.

Returns
const std::vector<arrow_proxy>& A constant reference to the vector containing the child arrow proxies.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

◆ data_type()

SPARROW_API enum data_type sparrow::arrow_proxy::data_type ( ) const
nodiscard

Gets the data type enum corresponding to the format.

Returns
Data type enumeration value
Postcondition
Returns data type consistent with format string
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dictionary() [1/2]

SPARROW_API std::unique_ptr< arrow_proxy > & sparrow::arrow_proxy::dictionary ( )
nodiscard

Returns a mutable reference to the dictionary arrow proxy.

This method provides read-write access to the dictionary arrow proxy associated with this arrow array schema proxy. The dictionary is used for encoding categorical data types.

Returns
std::unique_ptr<arrow_proxy>& A mutable reference to the dictionary arrow proxy, or nullptr if no dictionary is set.

◆ dictionary() [2/2]

SPARROW_API const std::unique_ptr< arrow_proxy > & sparrow::arrow_proxy::dictionary ( ) const
nodiscard

Returns a constant reference to the dictionary arrow proxy.

This method provides read-only access to the dictionary arrow proxy associated with this arrow array schema proxy. The dictionary is used for encoding categorical data types.

Returns
const std::unique_ptr<arrow_proxy>& A constant reference to the dictionary arrow proxy, or nullptr if no dictionary is set.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

◆ erase_bitmap()

SPARROW_API size_t sparrow::arrow_proxy::erase_bitmap ( size_t index,
size_t count = 1 )

Erases validity bits starting at specified position.

Parameters
indexPosition where to start erasing bits
countNumber of bits to erase
Returns
Index of the first erased bit
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
Data type must support validity bitmap
index must be < current bitmap length
index + count must not exceed bitmap length
count must be >= 0
Postcondition
count bits starting at index are removed
Bitmap length decreases by count
Subsequent bits are shifted left
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
arrow_proxy_exceptionif data type doesn't support validity bitmap
std::out_of_rangeif index >= bitmap length
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ extract_array()

SPARROW_API ArrowArray sparrow::arrow_proxy::extract_array ( )
nodiscard

Extract the ArrowArray from the proxy, and transfers the responsibility to release it after usage to the caller.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` was not created with sparrow.

The schema flags can be updated by adding sparrow::ArrowFlag::NULLABLE, if null_count is greater than 0.

Returns
The array.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ extract_schema()

SPARROW_API ArrowSchema sparrow::arrow_proxy::extract_schema ( )
nodiscard

Extract the ArrowSchema from the proxy, and transfers the responsibility to release it after usage to the caller.

Exceptions
`arrow_proxy_exception`If the `ArrowSchema` was not created with sparrow.

The schema flags can be updated by adding sparrow::ArrowFlag::NULLABLE, if null_count is greater than 0.

Returns
The ArrowSchema.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ flags()

SPARROW_API std::unordered_set< ArrowFlag > sparrow::arrow_proxy::flags ( ) const
nodiscard

Gets the Arrow flags set for this array.

Returns
Set of Arrow flags
Postcondition
Returns current flag configuration
Flags reflect capabilities and constraints of the array
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ format()

SPARROW_API const std::string_view sparrow::arrow_proxy::format ( ) const
nodiscard

Gets the Arrow format string describing the data type.

Returns
String view of the format specification
Postcondition
Returns valid format string according to Arrow specification
Format string remains valid while proxy exists
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ get_array_private_data()

SPARROW_API arrow_array_private_data * sparrow::arrow_proxy::get_array_private_data ( )
nodiscard
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ get_schema_private_data()

SPARROW_API arrow_schema_private_data * sparrow::arrow_proxy::get_schema_private_data ( )
nodiscard
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ insert_bitmap() [1/2]

SPARROW_API size_t sparrow::arrow_proxy::insert_bitmap ( size_t index,
bool value,
size_t count = 1 )

Inserts validity bits with the same value at specified position.

Parameters
indexPosition where to insert bits
valueValidity value to insert (true = valid, false = null)
countNumber of bits to insert
Returns
Index of the first inserted bit
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
Data type must support validity bitmap
index must be <= current bitmap length
count must be >= 0
Postcondition
count bits with specified value are inserted at index
Bitmap length increases by count
Subsequent bits are shifted right
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
arrow_proxy_exceptionif data type doesn't support validity bitmap
std::out_of_rangeif index > bitmap length
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ insert_bitmap() [2/2]

template<std::ranges::input_range R>
size_t sparrow::arrow_proxy::insert_bitmap ( size_t index,
const R & range )
inline

Inserts a range of validity bits at specified position.

Template Parameters
RRange type containing boolean values
Parameters
indexPosition where to insert bits
rangeRange of boolean values to insert
Returns
Index of the first inserted bit
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
Data type must support validity bitmap
index must be <= current bitmap length
range must be a valid input range of boolean-convertible values
Postcondition
All bits from range are inserted at index
Bitmap length increases by range size
Subsequent bits are shifted right
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
arrow_proxy_exceptionif data type doesn't support validity bitmap
std::out_of_rangeif index > bitmap length
Note
Internal assertion: SPARROW_ASSERT_TRUE(has_bitmap(data_type()))

Definition at line 994 of file arrow_array_schema_proxy.hpp.

Here is the call graph for this function:

◆ is_created_with_sparrow()

SPARROW_API bool sparrow::arrow_proxy::is_created_with_sparrow ( ) const
nodiscard

Check if the ArrowArray and ArrowSchema were created with sparrow.

Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ length()

SPARROW_API size_t sparrow::arrow_proxy::length ( ) const
nodiscard

Gets the number of elements in the array.

Returns
Number of elements
Postcondition
Returns non-negative value
Value is consistent with buffer sizes
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ metadata()

SPARROW_API std::optional< key_value_view > sparrow::arrow_proxy::metadata ( ) const
nodiscard

Gets the metadata key-value pairs.

Returns
Optional view of metadata key-value pairs
Postcondition
Returns nullopt if no metadata is set
Returned view remains valid while proxy exists
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ n_buffers()

SPARROW_API size_t sparrow::arrow_proxy::n_buffers ( ) const
nodiscard

Gets the number of buffers in the array.

Returns
Number of buffers
Postcondition
Returns value consistent with data type requirements
Value matches buffers().size()
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ n_children()

SPARROW_API size_t sparrow::arrow_proxy::n_children ( ) const
nodiscard

Gets the number of child arrays.

Returns
Number of child arrays
Postcondition
Returns value consistent with data type (0 for primitive types)
Value matches children().size()
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ name()

SPARROW_API std::optional< std::string_view > sparrow::arrow_proxy::name ( ) const
nodiscard

Gets the optional name of the array/field.

Returns
Optional string view of the name
Postcondition
Returns nullopt if no name is set
Returned string view remains valid while proxy exists
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ null_count()

SPARROW_API int64_t sparrow::arrow_proxy::null_count ( ) const
nodiscard

Gets the number of null values in the array.

Returns
Number of null values (-1 if unknown)
Postcondition
Returns value consistent with validity bitmap
-1 indicates null count should be computed
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ offset()

SPARROW_API size_t sparrow::arrow_proxy::offset ( ) const
nodiscard

Gets the starting offset within the buffers.

Returns
Starting offset for array data
Postcondition
Returns non-negative value
Offset is used for array slicing operations
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ operator=() [1/2]

SPARROW_API arrow_proxy & sparrow::arrow_proxy::operator= ( arrow_proxy && other)
noexcept

Move assignment operator.

Parameters
otherSource arrow_proxy to move from
Returns
Reference to this arrow_proxy
Precondition
other must be in a valid state
Postcondition
This proxy takes ownership from other
Previous structures are properly released (if owned)
other is left in a valid but unspecified state
Here is the call graph for this function:

◆ operator=() [2/2]

SPARROW_API arrow_proxy & sparrow::arrow_proxy::operator= ( const arrow_proxy & other)

Copy assignment operator.

Parameters
otherSource arrow_proxy to copy from
Returns
Reference to this arrow_proxy
Precondition
other must be in a valid state
Postcondition
This proxy is an independent copy of other
Previous structures are properly released (if owned)
Deep copy of all children and dictionary (if owned)
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ owns_array()

SPARROW_API bool sparrow::arrow_proxy::owns_array ( ) const
nodiscard

Check whether the proxy has ownership of its internal the ArrowArray.

Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ owns_schema()

SPARROW_API bool sparrow::arrow_proxy::owns_schema ( ) const
nodiscard

Check whether the proxy has ownership of its internal the ArrowSchema.

Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ pop_back_bitmap()

SPARROW_API void sparrow::arrow_proxy::pop_back_bitmap ( )

Removes the last validity bit from the bitmap.

Precondition
ArrowArray must be created with sparrow (owned by this proxy)
Data type must support validity bitmap
Bitmap must not be empty
Postcondition
Last bit is removed from the bitmap
Bitmap length decreases by 1
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
arrow_proxy_exceptionif data type doesn't support validity bitmap
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

◆ pop_children()

SPARROW_API void sparrow::arrow_proxy::pop_children ( size_t n)

Pop n children.

If the children were created by sparrow or are owned by the proxy, it will delete them.

Parameters
nThe number of children to pop.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

◆ private_data()

SPARROW_API void * sparrow::arrow_proxy::private_data ( ) const
nodiscard
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ push_back_bitmap()

SPARROW_API void sparrow::arrow_proxy::push_back_bitmap ( bool value)

Appends a validity bit at the end of the bitmap.

Parameters
valueValidity value to append (true = valid, false = null)
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
Data type must support validity bitmap
Postcondition
One bit with specified value is added at the end
Bitmap length increases by 1
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
arrow_proxy_exceptionif data type doesn't support validity bitmap
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

◆ resize_bitmap()

SPARROW_API void sparrow::arrow_proxy::resize_bitmap ( size_t new_size,
bool value = true )

Resizes the validity bitmap buffer.

Parameters
new_sizeNew size for the bitmap buffer
valueDefault value for new bits (true = valid, false = null)
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
Data type must support validity bitmap
new_size should be consistent with array length requirements
Postcondition
Bitmap buffer is resized to accommodate new_size bits
New bits (if any) are set to the specified value
Existing bits are preserved
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
arrow_proxy_exceptionif data type doesn't support validity bitmap
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ schema() [1/2]

SPARROW_API ArrowSchema & sparrow::arrow_proxy::schema ( )
nodiscard

Get a reference to the ArrowSchema of the proxy.

The proxy is still reponsible for releasing it, and the reference returned from this method should not outlive the proxy.

The schema flags can be updated by adding sparrow::ArrowFlag::NULLABLE, if null_count is greater than 0.

Returns
The ArrowSchema reference.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the caller graph for this function:

◆ schema() [2/2]

SPARROW_API const ArrowSchema & sparrow::arrow_proxy::schema ( ) const
nodiscard

Get a const reference to the ArrowSchema of the proxy.

The proxy is still reponsible for releasing it, and the reference returned from this method should not outlive the proxy.

The schema flags can be updated by adding sparrow::ArrowFlag::NULLABLE, if null_count is greater than 0.

Returns
The ArrowSchema const reference.

◆ set_buffer() [1/2]

SPARROW_API void sparrow::arrow_proxy::set_buffer ( size_t index,
buffer< uint8_t > && buffer )

Sets a specific buffer by moving it at the given index.

Parameters
indexIndex of the buffer to set
bufferBuffer to move and set
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
index must be < n_buffers()
set_length() should be called first for proper buffer sizing
buffer must be appropriate for the data type and index
Postcondition
Buffer at index is updated to the moved buffer
Buffer views are refreshed automatically
Original buffer is moved and becomes invalid
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
std::out_of_rangeif index >= n_buffers()

◆ set_buffer() [2/2]

SPARROW_API void sparrow::arrow_proxy::set_buffer ( size_t index,
const buffer_view< uint8_t > & buffer )

Sets a specific buffer at the given index.

Parameters
indexIndex of the buffer to set
bufferBuffer view to set
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
index must be < n_buffers()
set_length() should be called first for proper buffer sizing
buffer must be appropriate for the data type and index
Postcondition
Buffer at index is updated to the specified buffer
Buffer views are refreshed automatically
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
std::out_of_rangeif index >= n_buffers()
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

◆ set_child() [1/2]

SPARROW_API void sparrow::arrow_proxy::set_child ( size_t index,
ArrowArray && array,
ArrowSchema && schema )

Set the child at the given index.

It takes the ownership on the ArrowArray andArrowSchema passed by rvalue referencess.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` or `ArrowSchema` wrapped in this proxy were not created with sparrow.
Parameters
indexThe index of the child to set.
arrayThe ArrowArray to set as child.
schemaThe ArrowSchema to set as child.
Here is the call graph for this function:

◆ set_child() [2/2]

SPARROW_API void sparrow::arrow_proxy::set_child ( size_t index,
ArrowArray * array,
ArrowSchema * schema )

Set the child at the given index.

It does not take the ownership on the ArrowArray and ArrowSchema passed by pointers.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` or the `ArrowSchema` wrapped in this proxy were not created with sparrow.
Parameters
indexThe index of the child to set.
arrayThe ArrowArray to set as child.
schemaThe ArrowSchema to set as child.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_data_type()

void SPARROW_API sparrow::arrow_proxy::set_data_type ( enum data_type data_type)

Sets the data type (updates format string accordingly).

Parameters
data_typeNew data type to set
Precondition
ArrowSchema must be created with sparrow (owned by this proxy)
data_type must be a valid sparrow data type
Postcondition
Schema format is updated to match the data type
Format string is updated accordingly
Exceptions
arrow_proxy_exceptionif schema is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ set_dictionary() [1/2]

SPARROW_API void sparrow::arrow_proxy::set_dictionary ( ArrowArray && array_dictionary,
ArrowSchema && schema_dictionary )

Set the dictionary.

It takes the ownership on the ArrowArray andArrowSchema passed by rvalue referencess.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` or `ArrowSchema` wrapped in this proxy were not created with sparrow.
Parameters
array_dictionaryThe ArrowArray to set as dictionary.
schema_dictionaryThe ArrowSchema to set as dictionary.s

◆ set_dictionary() [2/2]

SPARROW_API void sparrow::arrow_proxy::set_dictionary ( ArrowArray * array,
ArrowSchema * schema )

Set the dictionary.It does not take the ownership on the ArrowArray and ArrowSchema passed by pointers.

Exceptions
`arrow_proxy_exception`If the `ArrowArray` or `ArrowSchema` were not created with sparrow.
Parameters
arrayThe ArrowArray to set as dictionary.
schemaThe ArrowSchema to set as dictionary.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ set_flags()

SPARROW_API void sparrow::arrow_proxy::set_flags ( const std::unordered_set< ArrowFlag > & flags)

Sets the Arrow flags for this array.

Parameters
flagsSet of Arrow flags to apply
Precondition
ArrowSchema must be created with sparrow (owned by this proxy)
Flags must be compatible with the data type
Postcondition
Schema flags are updated to the specified values
Flags affect array behavior and validation
Exceptions
arrow_proxy_exceptionif schema is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ set_format()

SPARROW_API void sparrow::arrow_proxy::set_format ( const std::string_view format)

Sets the Arrow format string.

Parameters
formatNew format string to set
Precondition
ArrowSchema must be created with sparrow (owned by this proxy)
format must be a valid Arrow format string
Postcondition
Schema format is updated to the specified value
Data type is updated accordingly
Exceptions
arrow_proxy_exceptionif schema is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ set_length()

SPARROW_API void sparrow::arrow_proxy::set_length ( size_t length)

Sets the number of elements in the array.

This method updates the length field but does not resize buffers. Buffers should be resized separately to match the new length.

Parameters
lengthNew number of elements
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
length should be consistent with buffer sizes after buffer operations
Postcondition
Array length is updated to the specified value
Buffer operations should follow to maintain consistency
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_metadata()

template<input_metadata_container R>
void sparrow::arrow_proxy::set_metadata ( std::optional< R > metadata)
inline

Sets the metadata key-value pairs.

Template Parameters
RContainer type for metadata pairs
Parameters
metadataOptional metadata container (nullopt to clear)
Precondition
ArrowSchema must be created with sparrow (owned by this proxy)
R must satisfy input_metadata_container concept
Postcondition
Schema metadata is updated to the specified values
Metadata can be retrieved via metadata() method
Exceptions
arrow_proxy_exceptionif schema is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

Definition at line 312 of file arrow_array_schema_proxy.hpp.

Here is the call graph for this function:

◆ set_n_buffers()

SPARROW_API void sparrow::arrow_proxy::set_n_buffers ( size_t n_buffers)

Sets the number of buffers and resizes the buffer vector.

Parameters
n_buffersNew number of buffers
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
n_buffers must be appropriate for the data type
Postcondition
Buffer vector is resized to n_buffers
Additional buffers are initialized as empty
Removed buffers are properly released
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ set_name()

SPARROW_API void sparrow::arrow_proxy::set_name ( std::optional< std::string_view > name)

Sets the name of the array/field.

Parameters
nameOptional name to set (nullopt to clear)
Precondition
ArrowSchema must be created with sparrow (owned by this proxy)
Postcondition
Schema name is updated to the specified value
Name can be retrieved via name() method
Exceptions
arrow_proxy_exceptionif schema is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ set_null_count()

SPARROW_API void sparrow::arrow_proxy::set_null_count ( int64_t null_count)

Sets the number of null values in the array.

This method updates the null count field but does not modify the bitmap. The bitmap should be updated separately to reflect the actual null count.

Parameters
null_countNew null count (-1 for unknown)
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
null_count should be consistent with actual validity bitmap
Postcondition
Array null count is updated to the specified value
Bitmap operations should follow to maintain consistency
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ set_offset()

SPARROW_API void sparrow::arrow_proxy::set_offset ( size_t offset)

Sets the starting offset within the buffers.

Parameters
offsetNew starting offset
Precondition
ArrowArray must be created with sparrow (owned by this proxy)
offset must be within buffer bounds
offset + length must not exceed buffer capacity
Postcondition
Array offset is updated to the specified value
Effective array data starts at the new offset
Exceptions
arrow_proxy_exceptionif array is not owned by sparrow
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ slice()

SPARROW_API arrow_proxy sparrow::arrow_proxy::slice ( size_t start,
size_t end ) const
nodiscard

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.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ slice_view()

SPARROW_API arrow_proxy sparrow::arrow_proxy::slice_view ( size_t start,
size_t end ) const
nodiscard

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.
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

◆ update_buffers()

SPARROW_API void sparrow::arrow_proxy::update_buffers ( )

Refresh the buffers views.

This method should be called after modifying the buffers of the array.

Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.

◆ view()

SPARROW_API arrow_proxy sparrow::arrow_proxy::view ( ) const
nodiscard

Get a non-owning view of the arrow_proxy.

Examples
/home/runner/work/sparrow/sparrow/include/sparrow/arrow_interface/arrow_array_schema_proxy.hpp.
Here is the call graph for this function:

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