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

#include <arrow/builder.h>

Inheritance diagram for arrow::BooleanBuilder:
arrow::ArrayBuilder

Public Member Functions

 BooleanBuilder (MemoryPool *pool ARROW_MEMORY_POOL_DEFAULT)
 
 BooleanBuilder (const std::shared_ptr< DataType > &type, MemoryPool *pool)
 
Status AppendNulls (const uint8_t *valid_bytes, int64_t length)
 Write nulls as uint8_t* (0 value indicates null) into pre-allocated memory. More...
 
Status AppendNull ()
 
std::shared_ptr< Bufferdata () const
 
Status Append (const bool val)
 Scalar append. More...
 
Status Append (const uint8_t val)
 
Status Append (const uint8_t *values, int64_t length, const uint8_t *valid_bytes=NULLPTR)
 Append a sequence of elements in one shot. More...
 
Status Append (const uint8_t *values, int64_t length, const std::vector< bool > &is_valid)
 Append a sequence of elements in one shot. More...
 
Status Append (const std::vector< uint8_t > &values, const std::vector< bool > &is_valid)
 Append a sequence of elements in one shot. More...
 
Status Append (const std::vector< uint8_t > &values)
 Append a sequence of elements in one shot. More...
 
Status Append (const std::vector< bool > &values, const std::vector< bool > &is_valid)
 Append a sequence of elements in one shot. More...
 
Status Append (const std::vector< bool > &values)
 Append a sequence of elements in one shot. More...
 
Status FinishInternal (std::shared_ptr< ArrayData > *out) override
 Return result of builder as an internal generic ArrayData object. More...
 
Status Init (int64_t capacity) override
 Allocates initial capacity requirements for the builder. More...
 
Status Resize (int64_t capacity) override
 Increase the capacity of the builder to accommodate at least the indicated number of elements. More...
 
- Public Member Functions inherited from arrow::ArrayBuilder
 ArrayBuilder (const std::shared_ptr< DataType > &type, MemoryPool *pool)
 
virtual ~ArrayBuilder ()=default
 
ArrayBuilderchild (int i)
 For nested types. More...
 
int num_children () const
 
int64_t length () const
 
int64_t null_count () const
 
int64_t capacity () const
 
Status AppendToBitmap (bool is_valid)
 Append to null bitmap. More...
 
Status AppendToBitmap (const uint8_t *valid_bytes, int64_t length)
 Vector append. More...
 
Status SetNotNull (int64_t length)
 Set the next length bits to not null (i.e. valid). More...
 
Status Reserve (int64_t elements)
 Ensures there is enough space for adding the number of elements by checking capacity and calling Resize if necessary. More...
 
Status Advance (int64_t elements)
 For cases where raw data was memcpy'd into the internal buffers, allows us to advance the length of the builder. More...
 
std::shared_ptr< PoolBuffernull_bitmap () const
 
Status Finish (std::shared_ptr< Array > *out)
 Return result of builder as an Array object. More...
 
std::shared_ptr< DataTypetype () const
 

Protected Attributes

std::shared_ptr< PoolBufferdata_
 
uint8_t * raw_data_
 
- Protected Attributes inherited from arrow::ArrayBuilder
std::shared_ptr< DataTypetype_
 
MemoryPoolpool_
 
std::shared_ptr< PoolBuffernull_bitmap_
 
int64_t null_count_
 
uint8_t * null_bitmap_data_
 
int64_t length_
 
int64_t capacity_
 
std::vector< std::unique_ptr< ArrayBuilder > > children_
 

Additional Inherited Members

- Protected Member Functions inherited from arrow::ArrayBuilder
 ArrayBuilder ()
 
void Reset ()
 
void UnsafeAppendToBitmap (bool is_valid)
 
void UnsafeAppendToBitmap (const uint8_t *valid_bytes, int64_t length)
 
void UnsafeAppendToBitmap (const std::vector< bool > &is_valid)
 
void UnsafeSetNotNull (int64_t length)
 

Constructor & Destructor Documentation

◆ BooleanBuilder() [1/2]

arrow::BooleanBuilder::BooleanBuilder ( MemoryPool *pool  ARROW_MEMORY_POOL_DEFAULT)
explicit

◆ BooleanBuilder() [2/2]

arrow::BooleanBuilder::BooleanBuilder ( const std::shared_ptr< DataType > &  type,
MemoryPool pool 
)
explicit

Member Function Documentation

◆ Append() [1/8]

Status arrow::BooleanBuilder::Append ( const bool  val)
inline

Scalar append.

◆ Append() [2/8]

Status arrow::BooleanBuilder::Append ( const uint8_t  val)
inline

◆ Append() [3/8]

Status arrow::BooleanBuilder::Append ( const uint8_t *  values,
int64_t  length,
const uint8_t *  valid_bytes = NULLPTR 
)

Append a sequence of elements in one shot.

Parameters
[in]valuesa contiguous array of bytes (non-zero is 1)
[in]lengththe number of values to append
[in]valid_bytesan optional sequence of bytes where non-zero indicates a valid (non-null) value
Returns
Status

◆ Append() [4/8]

Status arrow::BooleanBuilder::Append ( const uint8_t *  values,
int64_t  length,
const std::vector< bool > &  is_valid 
)

Append a sequence of elements in one shot.

Parameters
[in]valuesa contiguous C array of values
[in]lengththe number of values to append
[in]is_validan std::vector<bool> indicating valid (1) or null (0). Equal in length to values
Returns
Status

◆ Append() [5/8]

Status arrow::BooleanBuilder::Append ( const std::vector< uint8_t > &  values,
const std::vector< bool > &  is_valid 
)

Append a sequence of elements in one shot.

Parameters
[in]valuesa std::vector of bytes
[in]is_validan std::vector<bool> indicating valid (1) or null (0). Equal in length to values
Returns
Status

◆ Append() [6/8]

Status arrow::BooleanBuilder::Append ( const std::vector< uint8_t > &  values)

Append a sequence of elements in one shot.

Parameters
[in]valuesa std::vector of bytes
Returns
Status

◆ Append() [7/8]

Status arrow::BooleanBuilder::Append ( const std::vector< bool > &  values,
const std::vector< bool > &  is_valid 
)

Append a sequence of elements in one shot.

Parameters
[in]valuesan std::vector<bool> indicating true (1) or false
[in]is_validan std::vector<bool> indicating valid (1) or null (0). Equal in length to values
Returns
Status

◆ Append() [8/8]

Status arrow::BooleanBuilder::Append ( const std::vector< bool > &  values)

Append a sequence of elements in one shot.

Parameters
[in]valuesan std::vector<bool> indicating true (1) or false
Returns
Status

◆ AppendNull()

Status arrow::BooleanBuilder::AppendNull ( )
inline

◆ AppendNulls()

Status arrow::BooleanBuilder::AppendNulls ( const uint8_t *  valid_bytes,
int64_t  length 
)
inline

Write nulls as uint8_t* (0 value indicates null) into pre-allocated memory.

◆ data()

std::shared_ptr<Buffer> arrow::BooleanBuilder::data ( ) const
inline

◆ FinishInternal()

Status arrow::BooleanBuilder::FinishInternal ( std::shared_ptr< ArrayData > *  out)
overridevirtual

Return result of builder as an internal generic ArrayData object.

Resets builder

Parameters
[out]outthe finalized ArrayData object
Returns
Status

Implements arrow::ArrayBuilder.

◆ Init()

Status arrow::BooleanBuilder::Init ( int64_t  capacity)
overridevirtual

Allocates initial capacity requirements for the builder.

In most cases subclasses should override and call their parent class's method as well.

Reimplemented from arrow::ArrayBuilder.

◆ Resize()

Status arrow::BooleanBuilder::Resize ( int64_t  capacity)
overridevirtual

Increase the capacity of the builder to accommodate at least the indicated number of elements.

Reimplemented from arrow::ArrayBuilder.

Member Data Documentation

◆ data_

std::shared_ptr<PoolBuffer> arrow::BooleanBuilder::data_
protected

◆ raw_data_

uint8_t* arrow::BooleanBuilder::raw_data_
protected

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