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

An immutable column data structure consisting of a field (type metadata) and a chunked data array. More...

#include <arrow/table.h>

Public Member Functions

 Column (const std::shared_ptr< Field > &field, const ArrayVector &chunks)
 
 Column (const std::shared_ptr< Field > &field, const std::shared_ptr< ChunkedArray > &data)
 
 Column (const std::shared_ptr< Field > &field, const std::shared_ptr< Array > &data)
 
 Column (const std::string &name, const std::shared_ptr< Array > &data)
 
int64_t length () const
 
int64_t null_count () const
 
std::shared_ptr< Fieldfield () const
 
const std::string & name () const
 The column name. More...
 
std::shared_ptr< DataTypetype () const
 The column type. More...
 
std::shared_ptr< ChunkedArraydata () const
 The column data as a chunked array. More...
 
std::shared_ptr< ColumnSlice (int64_t offset, int64_t length) const
 Construct a zero-copy slice of the column with the indicated offset and length. More...
 
std::shared_ptr< ColumnSlice (int64_t offset) const
 Slice from offset until end of the column. More...
 
Status Flatten (MemoryPool *pool, std::vector< std::shared_ptr< Column >> *out) const
 Flatten this column as a vector of columns. More...
 
bool Equals (const Column &other) const
 
bool Equals (const std::shared_ptr< Column > &other) const
 
Status ValidateData ()
 Verify that the column's array data is consistent with the passed field's metadata. More...
 

Protected Attributes

std::shared_ptr< Fieldfield_
 
std::shared_ptr< ChunkedArraydata_
 

Detailed Description

An immutable column data structure consisting of a field (type metadata) and a chunked data array.

Constructor & Destructor Documentation

◆ Column() [1/4]

arrow::Column::Column ( const std::shared_ptr< Field > &  field,
const ArrayVector chunks 
)

◆ Column() [2/4]

arrow::Column::Column ( const std::shared_ptr< Field > &  field,
const std::shared_ptr< ChunkedArray > &  data 
)

◆ Column() [3/4]

arrow::Column::Column ( const std::shared_ptr< Field > &  field,
const std::shared_ptr< Array > &  data 
)

◆ Column() [4/4]

arrow::Column::Column ( const std::string &  name,
const std::shared_ptr< Array > &  data 
)

Member Function Documentation

◆ data()

std::shared_ptr<ChunkedArray> arrow::Column::data ( ) const
inline

The column data as a chunked array.

Returns
the column's data as a chunked logical array

◆ Equals() [1/2]

bool arrow::Column::Equals ( const Column other) const

◆ Equals() [2/2]

bool arrow::Column::Equals ( const std::shared_ptr< Column > &  other) const

◆ field()

std::shared_ptr<Field> arrow::Column::field ( ) const
inline

◆ Flatten()

Status arrow::Column::Flatten ( MemoryPool pool,
std::vector< std::shared_ptr< Column >> *  out 
) const

Flatten this column as a vector of columns.

Parameters
[in]poolThe pool for buffer allocations, if any
[out]outThe resulting vector of arrays

◆ length()

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

◆ name()

const std::string& arrow::Column::name ( ) const
inline

The column name.

Returns
the column's name in the passed metadata

◆ null_count()

int64_t arrow::Column::null_count ( ) const
inline

◆ Slice() [1/2]

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

Construct a zero-copy slice of the column 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 column, the length will be adjusted accordingly
Returns
a new object wrapped in std::shared_ptr<Column>

◆ Slice() [2/2]

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

Slice from offset until end of the column.

◆ type()

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

The column type.

Returns
the column's type according to the metadata

◆ ValidateData()

Status arrow::Column::ValidateData ( )

Verify that the column's array data is consistent with the passed field's metadata.

Member Data Documentation

◆ data_

std::shared_ptr<ChunkedArray> arrow::Column::data_
protected

◆ field_

std::shared_ptr<Field> arrow::Column::field_
protected

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