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

Array base type Immutable data array with some logical type and some length. More...

#include <arrow/array.h>

Inheritance diagram for arrow::Array:
arrow::DictionaryArray arrow::FlatArray arrow::ListArray arrow::StructArray arrow::UnionArray arrow::BinaryArray arrow::NullArray arrow::PrimitiveArray arrow::StringArray arrow::BooleanArray arrow::FixedSizeBinaryArray arrow::NumericArray< TYPE > arrow::DecimalArray

Public Member Functions

virtual ~Array ()=default
 
bool IsNull (int64_t i) const
 Return true if value at index is null. Does not boundscheck. More...
 
bool IsValid (int64_t i) const
 Return true if value at index is valid (not null). More...
 
int64_t length () const
 Size in the number of elements this array contains. More...
 
int64_t offset () const
 A relative position into another array's data, to enable zero-copy slicing. More...
 
int64_t null_count () const
 The number of null entries in the array. More...
 
std::shared_ptr< DataTypetype () const
 
Type::type type_id () const
 
std::shared_ptr< Buffernull_bitmap () const
 Buffer for the null bitmap. More...
 
const uint8_t * null_bitmap_data () const
 Raw pointer to the null bitmap. More...
 
bool Equals (const Array &arr) const
 
bool Equals (const std::shared_ptr< Array > &arr) const
 
bool ApproxEquals (const std::shared_ptr< Array > &arr) const
 
bool ApproxEquals (const Array &arr) const
 
bool RangeEquals (int64_t start_idx, int64_t end_idx, int64_t other_start_idx, const std::shared_ptr< Array > &other) const
 Compare if the range of slots specified are equal for the given array and this array. More...
 
bool RangeEquals (const Array &other, int64_t start_idx, int64_t end_idx, int64_t other_start_idx) const
 
Status Accept (ArrayVisitor *visitor) const
 
std::shared_ptr< ArraySlice (int64_t offset, int64_t length) const
 Construct a zero-copy slice of the array with the indicated offset and length. More...
 
std::shared_ptr< ArraySlice (int64_t offset) const
 Slice from offset until end of the array. More...
 
std::shared_ptr< ArrayDatadata () const
 
int num_fields () const
 
std::string ToString () const
 

Protected Member Functions

 Array ()
 
void SetData (const std::shared_ptr< ArrayData > &data)
 Protected method for constructors. More...
 

Protected Attributes

std::shared_ptr< ArrayDatadata_
 
const uint8_t * null_bitmap_data_
 

Detailed Description

Array base type Immutable data array with some logical type and some length.

Any memory is owned by the respective Buffer instance (or its parents).

The base class is only required to have a null bitmap buffer if the null count is greater than 0

If known, the null count can be provided in the base Array constructor. If the null count is not known, pass -1 to indicate that the null count is to be computed on the first call to null_count()

Constructor & Destructor Documentation

◆ ~Array()

virtual arrow::Array::~Array ( )
virtualdefault

◆ Array()

arrow::Array::Array ( )
inlineprotected

Member Function Documentation

◆ Accept()

Status arrow::Array::Accept ( ArrayVisitor visitor) const

◆ ApproxEquals() [1/2]

bool arrow::Array::ApproxEquals ( const std::shared_ptr< Array > &  arr) const

◆ ApproxEquals() [2/2]

bool arrow::Array::ApproxEquals ( const Array arr) const

◆ data()

std::shared_ptr<ArrayData> arrow::Array::data ( ) const
inline

◆ Equals() [1/2]

bool arrow::Array::Equals ( const Array arr) const

◆ Equals() [2/2]

bool arrow::Array::Equals ( const std::shared_ptr< Array > &  arr) const

◆ IsNull()

bool arrow::Array::IsNull ( int64_t  i) const
inline

Return true if value at index is null. Does not boundscheck.

◆ IsValid()

bool arrow::Array::IsValid ( int64_t  i) const
inline

Return true if value at index is valid (not null).

Does not boundscheck

◆ length()

int64_t arrow::Array::length ( ) const
inline

Size in the number of elements this array contains.

◆ null_bitmap()

std::shared_ptr<Buffer> arrow::Array::null_bitmap ( ) const
inline

Buffer for the null bitmap.

Note that for null_count == 0, this can be null. This buffer does not account for any slice offset

◆ null_bitmap_data()

const uint8_t* arrow::Array::null_bitmap_data ( ) const
inline

Raw pointer to the null bitmap.

Note that for null_count == 0, this can be null. This buffer does not account for any slice offset

◆ null_count()

int64_t arrow::Array::null_count ( ) const

The number of null entries in the array.

If the null count was not known at time of construction (and set to a negative value), then the null count will be computed and cached on the first invocation of this function

◆ num_fields()

int arrow::Array::num_fields ( ) const
inline

◆ offset()

int64_t arrow::Array::offset ( ) const
inline

A relative position into another array's data, to enable zero-copy slicing.

This value defaults to zero

◆ RangeEquals() [1/2]

bool arrow::Array::RangeEquals ( int64_t  start_idx,
int64_t  end_idx,
int64_t  other_start_idx,
const std::shared_ptr< Array > &  other 
) const

Compare if the range of slots specified are equal for the given array and this array.

end_idx exclusive. This methods does not bounds check.

◆ RangeEquals() [2/2]

bool arrow::Array::RangeEquals ( const Array other,
int64_t  start_idx,
int64_t  end_idx,
int64_t  other_start_idx 
) const

◆ SetData()

void arrow::Array::SetData ( const std::shared_ptr< ArrayData > &  data)
inlineprotected

Protected method for constructors.

◆ Slice() [1/2]

std::shared_ptr<Array> arrow::Array::Slice ( int64_t  offset,
int64_t  length 
) const

Construct a zero-copy slice of the array with the indicated offset and length.

Parameters
[in]offsetthe position of the first element in the constructed slice
[in]lengththe length of the slice. If there are not enough elements in the array, the length will be adjusted accordingly
Returns
a new object wrapped in std::shared_ptr<Array>

◆ Slice() [2/2]

std::shared_ptr<Array> arrow::Array::Slice ( int64_t  offset) const

Slice from offset until end of the array.

◆ ToString()

std::string arrow::Array::ToString ( ) const
Returns
PrettyPrint representation of array suitable for debugging

◆ type()

std::shared_ptr<DataType> arrow::Array::type ( ) const
inline

◆ type_id()

Type::type arrow::Array::type_id ( ) const
inline

Member Data Documentation

◆ data_

std::shared_ptr<ArrayData> arrow::Array::data_
protected

◆ null_bitmap_data_

const uint8_t* arrow::Array::null_bitmap_data_
protected

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