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

Base class for all Builders that emit an Array of a scalar numerical type. More...

#include <arrow/builder.h>

Inheritance diagram for arrow::NumericBuilder< T >:
arrow::PrimitiveBuilder< T > arrow::ArrayBuilder

Public Member Functions

template<typename T1 = T>
 NumericBuilder (typename std::enable_if< TypeTraits< T1 >::is_parameter_free, MemoryPool *>::type pool ARROW_MEMORY_POOL_DEFAULT)
 
Status Append (const value_type val)
 Append a single scalar and increase the size if necessary. More...
 
void UnsafeAppend (const value_type val)
 Append a single scalar under the assumption that the underlying Buffer is large enough. More...
 
- Public Member Functions inherited from arrow::PrimitiveBuilder< T >
 PrimitiveBuilder (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 value_type *values, int64_t length, const uint8_t *valid_bytes=NULLPTR)
 Append a sequence of elements in one shot. More...
 
Status Append (const value_type *values, int64_t length, const std::vector< bool > &is_valid)
 Append a sequence of elements in one shot. More...
 
Status Append (const std::vector< value_type > &values, const std::vector< bool > &is_valid)
 Append a sequence of elements in one shot. More...
 
Status Append (const std::vector< value_type > &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
 

Additional Inherited Members

- Public Types inherited from arrow::PrimitiveBuilder< T >
using value_type = typename T ::c_type
 
- 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)
 
- Protected Attributes inherited from arrow::PrimitiveBuilder< T >
std::shared_ptr< PoolBufferdata_
 
value_typeraw_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_
 

Detailed Description

template<typename T>
class arrow::NumericBuilder< T >

Base class for all Builders that emit an Array of a scalar numerical type.

Constructor & Destructor Documentation

◆ NumericBuilder()

template<typename T >
template<typename T1 = T>
arrow::NumericBuilder< T >::NumericBuilder ( typename std::enable_if< TypeTraits< T1 >::is_parameter_free, MemoryPool *>::type pool  ARROW_MEMORY_POOL_DEFAULT)
inlineexplicit

Member Function Documentation

◆ Append()

template<typename T >
Status arrow::NumericBuilder< T >::Append ( const value_type  val)
inline

Append a single scalar and increase the size if necessary.

◆ UnsafeAppend()

template<typename T >
void arrow::NumericBuilder< T >::UnsafeAppend ( const value_type  val)
inline

Append a single scalar under the assumption that the underlying Buffer is large enough.

This method does not capacity-check; make sure to call Reserve beforehand.


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