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

Builder class for UTF8 strings. More...

#include <arrow/builder.h>

Inheritance diagram for arrow::StringBuilder:
arrow::BinaryBuilder arrow::ArrayBuilder

Public Member Functions

 StringBuilder (MemoryPool *pool ARROW_MEMORY_POOL_DEFAULT)
 
Status AppendValues (const std::vector< std::string > &values, const uint8_t *valid_bytes=NULLPTR)
 Append a sequence of strings in one shot. More...
 
Status Append (const std::vector< std::string > &values, const uint8_t *valid_bytes=NULLPTR)
 
Status AppendValues (const char **values, int64_t length, const uint8_t *valid_bytes=NULLPTR)
 Append a sequence of nul-terminated strings in one shot. More...
 
Status Append (const char **values, int64_t length, const uint8_t *valid_bytes=NULLPTR)
 
 BinaryBuilder (MemoryPool *pool ARROW_MEMORY_POOL_DEFAULT)
 
 BinaryBuilder (const std::shared_ptr< DataType > &type, MemoryPool *pool)
 
Status Append (const uint8_t *value, int32_t length)
 
Status Append (const char *value, int32_t length)
 
Status Append (const std::string &value)
 
- Public Member Functions inherited from arrow::BinaryBuilder
 BinaryBuilder (MemoryPool *pool ARROW_MEMORY_POOL_DEFAULT)
 
 BinaryBuilder (const std::shared_ptr< DataType > &type, MemoryPool *pool)
 
Status Append (const uint8_t *value, int32_t length)
 
Status Append (const char *value, int32_t length)
 
Status Append (const std::string &value)
 
Status AppendNull ()
 
Status Init (int64_t elements) override
 Allocates initial capacity requirements for the builder. More...
 
Status Resize (int64_t capacity) override
 Resizes the null_bitmap array. More...
 
Status ReserveData (int64_t elements)
 Ensures there is enough allocated capacity to append the indicated number of bytes to the value data buffer without additional allocations. More...
 
Status FinishInternal (std::shared_ptr< ArrayData > *out) override
 Return result of builder as an internal generic ArrayData object. More...
 
int64_t value_data_length () const
 
int64_t value_data_capacity () const
 
const uint8_t * GetValue (int64_t i, int32_t *out_length) const
 Temporary access to a value. 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
 
void UnsafeAppendToBitmap (bool is_valid)
 

Additional Inherited Members

- Protected Member Functions inherited from arrow::BinaryBuilder
Status AppendNextOffset ()
 
void Reset ()
 
- Protected Member Functions inherited from arrow::ArrayBuilder
 ArrayBuilder ()
 
void Reset ()
 
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::BinaryBuilder
TypedBufferBuilder< int32_t > offsets_builder_
 
TypedBufferBuilder< uint8_t > value_data_builder_
 
- 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

Builder class for UTF8 strings.

Constructor & Destructor Documentation

◆ StringBuilder()

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

Member Function Documentation

◆ Append() [1/5]

Status arrow::BinaryBuilder::Append

◆ Append() [2/5]

Status arrow::BinaryBuilder::Append
inline

◆ Append() [3/5]

Status arrow::BinaryBuilder::Append
inline

◆ Append() [4/5]

Status arrow::StringBuilder::Append ( const std::vector< std::string > &  values,
const uint8_t *  valid_bytes = NULLPTR 
)
Deprecated:
Use AppendValues instead.

◆ Append() [5/5]

Status arrow::StringBuilder::Append ( const char **  values,
int64_t  length,
const uint8_t *  valid_bytes = NULLPTR 
)
Deprecated:
Use AppendValues instead.

◆ AppendValues() [1/2]

Status arrow::StringBuilder::AppendValues ( const std::vector< std::string > &  values,
const uint8_t *  valid_bytes = NULLPTR 
)

Append a sequence of strings in one shot.

Parameters
[in]valuesa vector of strings
[in]valid_bytesan optional sequence of bytes where non-zero indicates a valid (non-null) value
Returns
Status

◆ AppendValues() [2/2]

Status arrow::StringBuilder::AppendValues ( const char **  values,
int64_t  length,
const uint8_t *  valid_bytes = NULLPTR 
)

Append a sequence of nul-terminated strings in one shot.

If one of the values is NULL, it is processed as a null value even if the corresponding valid_bytes entry is 1.

Parameters
[in]valuesa contiguous C array of nul-terminated char *
[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

◆ BinaryBuilder() [1/2]

arrow::BinaryBuilder::BinaryBuilder

◆ BinaryBuilder() [2/2]

arrow::BinaryBuilder::BinaryBuilder
explicit

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