Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Member Functions | Public Attributes | List of all members
arrow::ArrayData Class Reference

Mutable container for generic Arrow array data. More...

#include <arrow/array.h>

Public Member Functions

 ArrayData ()
 
 ArrayData (const std::shared_ptr< DataType > &type, int64_t length, int64_t null_count=kUnknownNullCount, int64_t offset=0)
 
 ArrayData (const std::shared_ptr< DataType > &type, int64_t length, const std::vector< std::shared_ptr< Buffer >> &buffers, int64_t null_count=kUnknownNullCount, int64_t offset=0)
 
 ArrayData (const std::shared_ptr< DataType > &type, int64_t length, std::vector< std::shared_ptr< Buffer >> &&buffers, int64_t null_count=kUnknownNullCount, int64_t offset=0)
 
 ArrayData (ArrayData &&other) noexcept
 
 ArrayData (const ArrayData &other) noexcept
 
ArrayDataoperator= (ArrayData &&other)
 
std::shared_ptr< ArrayDataShallowCopy () const
 

Public Attributes

std::shared_ptr< DataTypetype
 
int64_t length
 
int64_t null_count
 
int64_t offset
 
std::vector< std::shared_ptr< Buffer > > buffers
 
std::vector< std::shared_ptr< ArrayData > > child_data
 

Detailed Description

Mutable container for generic Arrow array data.

This data structure is a self-contained representation of the memory and metadata inside an Arrow array data structure (called vectors in Java). The classes arrow::Array and its subclasses provide strongly-typed accessors with support for the visitor pattern and other affordances.

This class is designed for easy internal data manipulation, analytical data processing, and data transport to and from IPC messages. For example, we could cast from int64 to float64 like so:

Int64Array arr = GetMyData(); auto new_data = arr->data()->ShallowCopy(); new_data->type = arrow::float64(); Float64Array double_arr(new_data);

This object is also useful in an analytics setting where memory may be reused. For example, if we had a group of operations all returning doubles, say:

Log(Sqrt(Expr(arr))

Then the low-level implementations of each of these functions could have the signatures

void Log(const ArrayData& values, ArrayData* out);

As another example a function may consume one or more memory buffers in an input array and replace them with newly-allocated data, changing the output data type as well.

Constructor & Destructor Documentation

◆ ArrayData() [1/6]

arrow::ArrayData::ArrayData ( )
inline

◆ ArrayData() [2/6]

arrow::ArrayData::ArrayData ( const std::shared_ptr< DataType > &  type,
int64_t  length,
int64_t  null_count = kUnknownNullCount,
int64_t  offset = 0 
)
inline

◆ ArrayData() [3/6]

arrow::ArrayData::ArrayData ( const std::shared_ptr< DataType > &  type,
int64_t  length,
const std::vector< std::shared_ptr< Buffer >> &  buffers,
int64_t  null_count = kUnknownNullCount,
int64_t  offset = 0 
)
inline

◆ ArrayData() [4/6]

arrow::ArrayData::ArrayData ( const std::shared_ptr< DataType > &  type,
int64_t  length,
std::vector< std::shared_ptr< Buffer >> &&  buffers,
int64_t  null_count = kUnknownNullCount,
int64_t  offset = 0 
)
inline

◆ ArrayData() [5/6]

arrow::ArrayData::ArrayData ( ArrayData &&  other)
inlinenoexcept

◆ ArrayData() [6/6]

arrow::ArrayData::ArrayData ( const ArrayData other)
inlinenoexcept

Member Function Documentation

◆ operator=()

ArrayData& arrow::ArrayData::operator= ( ArrayData &&  other)
inline

◆ ShallowCopy()

std::shared_ptr<ArrayData> arrow::ArrayData::ShallowCopy ( ) const
inline

Member Data Documentation

◆ buffers

std::vector<std::shared_ptr<Buffer> > arrow::ArrayData::buffers

◆ child_data

std::vector<std::shared_ptr<ArrayData> > arrow::ArrayData::child_data

◆ length

int64_t arrow::ArrayData::length

◆ null_count

int64_t arrow::ArrayData::null_count

◆ offset

int64_t arrow::ArrayData::offset

◆ type

std::shared_ptr<DataType> arrow::ArrayData::type

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