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 The memory at the corresponding data slot is set to 0 to prevent uninitialized memory access. More...
 
Status AppendNull ()
 
value_type GetValue (int64_t index) const
 
Status AppendValues (const value_type *values, int64_t length, const uint8_t *valid_bytes=NULLPTR)
 Append a sequence of elements in one shot. More...
 
Status AppendValues (const value_type *values, int64_t length, const std::vector< bool > &is_valid)
 Append a sequence of elements in one shot. More...
 
Status AppendValues (const std::vector< value_type > &values, const std::vector< bool > &is_valid)
 Append a sequence of elements in one shot. More...
 
Status AppendValues (const std::vector< value_type > &values)
 Append a sequence of elements in one shot. More...
 
Status AppendValues (ValuesIter values_begin, ValuesIter values_end)
 Append a sequence of elements in one shot. More...
 
std::enable_if<!std::is_pointer< ValidIter >::value, Status >::type AppendValues (ValuesIter values_begin, ValuesIter values_end, ValidIter valid_begin)
 Append a sequence of elements in one shot, with a specified nullmap. More...
 
std::enable_if< std::is_pointer< ValidIter >::value, Status >::type AppendValues (ValuesIter values_begin, ValuesIter values_end, ValidIter valid_begin)
 Append a sequence of elements in one shot, with a specified nullmap. More...
 
Status FinishInternal (std::shared_ptr< ArrayData > *out) override
 Return result of builder as an internal generic ArrayData object. More...
 
void Reset () override
 Reset the builder. More...
 
Status Resize (int64_t capacity) override
 Ensure that enough memory has been allocated to fit the indicated number of total elements in the builder, including any that have already been appended. 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...
 
- 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 additional_capacity)
 Ensure that there is enough space allocated to add the indicated number of elements without any further calls to Resize. 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...
 
Status Finish (std::shared_ptr< Array > *out)
 Return result of builder as an Array object. More...
 
std::shared_ptr< DataTypetype () const
 
void UnsafeAppendToBitmap (bool is_valid)
 
template<typename IterType >
void UnsafeAppendToBitmap (const IterType &begin, const IterType &end)
 

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 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< ResizableBufferdata_
 
value_typeraw_data_
 
- Protected Attributes inherited from arrow::ArrayBuilder
std::shared_ptr< DataTypetype_
 
MemoryPoolpool_
 
std::shared_ptr< ResizableBuffernull_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: