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::RecordBatchBuilder Class Reference

Helper class for creating record batches iteratively given a known schema. More...

#include <arrow/table_builder.h>

Public Member Functions

ArrayBuilderGetField (int i)
 Get base pointer to field builder. More...
 
template<typename T >
T * GetFieldAs (int i)
 Return field builder casted to indicated specific builder type. More...
 
Status Flush (bool reset_builders, std::shared_ptr< RecordBatch > *batch)
 Finish current batch and optionally reset. More...
 
Status Flush (std::shared_ptr< RecordBatch > *batch)
 Finish current batch and reset. More...
 
void SetInitialCapacity (int64_t capacity)
 Set the initial capacity for new builders. More...
 
int64_t initial_capacity () const
 The initial capacity for builders. More...
 
int num_fields () const
 The number of fields in the schema. More...
 
std::shared_ptr< Schemaschema () const
 The number of fields in the schema. More...
 

Static Public Member Functions

static Status Make (const std::shared_ptr< Schema > &schema, MemoryPool *pool, std::unique_ptr< RecordBatchBuilder > *builder)
 Create an initialize a RecordBatchBuilder. More...
 
static Status Make (const std::shared_ptr< Schema > &schema, MemoryPool *pool, int64_t initial_capacity, std::unique_ptr< RecordBatchBuilder > *builder)
 Create an initialize a RecordBatchBuilder. More...
 

Detailed Description

Helper class for creating record batches iteratively given a known schema.

Member Function Documentation

◆ Flush() [1/2]

Status arrow::RecordBatchBuilder::Flush ( bool  reset_builders,
std::shared_ptr< RecordBatch > *  batch 
)

Finish current batch and optionally reset.

Parameters
[in]reset_buildersthe resulting RecordBatch
[out]batchthe resulting RecordBatch
Returns
Status

◆ Flush() [2/2]

Status arrow::RecordBatchBuilder::Flush ( std::shared_ptr< RecordBatch > *  batch)

Finish current batch and reset.

Parameters
[out]batchthe resulting RecordBatch
Returns
Status

◆ GetField()

ArrayBuilder* arrow::RecordBatchBuilder::GetField ( int  i)
inline

Get base pointer to field builder.

Parameters
ithe field index
Returns
pointer to ArrayBuilder

◆ GetFieldAs()

template<typename T >
T* arrow::RecordBatchBuilder::GetFieldAs ( int  i)
inline

Return field builder casted to indicated specific builder type.

Parameters
ithe field index
Returns
pointer to template type

◆ initial_capacity()

int64_t arrow::RecordBatchBuilder::initial_capacity ( ) const
inline

The initial capacity for builders.

◆ Make() [1/2]

static Status arrow::RecordBatchBuilder::Make ( const std::shared_ptr< Schema > &  schema,
MemoryPool pool,
std::unique_ptr< RecordBatchBuilder > *  builder 
)
static

Create an initialize a RecordBatchBuilder.

Parameters
[in]schemaThe schema for the record batch
[in]poolA MemoryPool to use for allocations
[in]builderthe created builder instance

◆ Make() [2/2]

static Status arrow::RecordBatchBuilder::Make ( const std::shared_ptr< Schema > &  schema,
MemoryPool pool,
int64_t  initial_capacity,
std::unique_ptr< RecordBatchBuilder > *  builder 
)
static

Create an initialize a RecordBatchBuilder.

Parameters
[in]schemaThe schema for the record batch
[in]poolA MemoryPool to use for allocations
[in]initial_capacityThe initial capacity for the builders
[in]builderthe created builder instance

◆ num_fields()

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

The number of fields in the schema.

◆ schema()

std::shared_ptr<Schema> arrow::RecordBatchBuilder::schema ( ) const
inline

The number of fields in the schema.

◆ SetInitialCapacity()

void arrow::RecordBatchBuilder::SetInitialCapacity ( int64_t  capacity)

Set the initial capacity for new builders.


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