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

Logical table as sequence of chunked arrays. More...

#include <arrow/table.h>

Public Member Functions

 Table (const std::shared_ptr< Schema > &schema, const std::vector< std::shared_ptr< Column >> &columns, int64_t num_rows=-1)
 Construct Table from schema and columns If columns is zero-length, the table's number of rows is zero. More...
 
 Table (const std::shared_ptr< Schema > &schema, const std::vector< std::shared_ptr< Array >> &arrays, int64_t num_rows=-1)
 Construct Table from schema and arrays. More...
 
std::shared_ptr< Schemaschema () const
 
std::shared_ptr< Columncolumn (int i) const
 
Status RemoveColumn (int i, std::shared_ptr< Table > *out) const
 Remove column from the table, producing a new Table. More...
 
Status AddColumn (int i, const std::shared_ptr< Column > &column, std::shared_ptr< Table > *out) const
 Add column to the table, producing a new Table. More...
 
std::shared_ptr< TableReplaceSchemaMetadata (const std::shared_ptr< const KeyValueMetadata > &metadata) const
 Replace schema key-value metadata with new metadata (EXPERIMENTAL) More...
 
int num_columns () const
 
int64_t num_rows () const
 
bool Equals (const Table &other) const
 Determine if semantic contents of tables are exactly equal. More...
 
Status ValidateColumns () const
 Perform any checks to validate the input arguments. More...
 
bool IsChunked () const
 Return true if any column has multiple chunks. More...
 

Static Public Member Functions

static Status FromRecordBatches (const std::vector< std::shared_ptr< RecordBatch >> &batches, std::shared_ptr< Table > *table)
 

Detailed Description

Logical table as sequence of chunked arrays.

Constructor & Destructor Documentation

◆ Table() [1/2]

arrow::Table::Table ( const std::shared_ptr< Schema > &  schema,
const std::vector< std::shared_ptr< Column >> &  columns,
int64_t  num_rows = -1 
)

Construct Table from schema and columns If columns is zero-length, the table's number of rows is zero.

Parameters
schemaThe table schema (column types)
columnsThe table's columns
num_rowsnumber of rows in table, -1 (default) to infer from columns

◆ Table() [2/2]

arrow::Table::Table ( const std::shared_ptr< Schema > &  schema,
const std::vector< std::shared_ptr< Array >> &  arrays,
int64_t  num_rows = -1 
)

Construct Table from schema and arrays.

Parameters
schemaThe table schema (column types)
arraysThe table's columns as arrays
num_rowsnumber of rows in table, -1 (default) to infer from columns

Member Function Documentation

◆ AddColumn()

Status arrow::Table::AddColumn ( int  i,
const std::shared_ptr< Column > &  column,
std::shared_ptr< Table > *  out 
) const

Add column to the table, producing a new Table.

◆ column()

std::shared_ptr<Column> arrow::Table::column ( int  i) const
inline
Parameters
[in]icolumn index, does not boundscheck
Returns
the i-th column

◆ Equals()

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

Determine if semantic contents of tables are exactly equal.

◆ FromRecordBatches()

static Status arrow::Table::FromRecordBatches ( const std::vector< std::shared_ptr< RecordBatch >> &  batches,
std::shared_ptr< Table > *  table 
)
static

◆ IsChunked()

bool arrow::Table::IsChunked ( ) const

Return true if any column has multiple chunks.

◆ num_columns()

int arrow::Table::num_columns ( ) const
inline
Returns
the number of columns in the table

◆ num_rows()

int64_t arrow::Table::num_rows ( ) const
inline
Returns
the number of rows (the corresponding length of each column)

◆ RemoveColumn()

Status arrow::Table::RemoveColumn ( int  i,
std::shared_ptr< Table > *  out 
) const

Remove column from the table, producing a new Table.

◆ ReplaceSchemaMetadata()

std::shared_ptr<Table> arrow::Table::ReplaceSchemaMetadata ( const std::shared_ptr< const KeyValueMetadata > &  metadata) const

Replace schema key-value metadata with new metadata (EXPERIMENTAL)

Since
0.5.0
Parameters
[in]metadatanew KeyValueMetadata
Returns
new Table

◆ schema()

std::shared_ptr<Schema> arrow::Table::schema ( ) const
inline
Returns
the table's schema

◆ ValidateColumns()

Status arrow::Table::ValidateColumns ( ) const

Perform any checks to validate the input arguments.


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