Table of Contents

Class DelegatingArrayBuilder<T, TArray, TBuilder>

Namespace
Apache.Arrow
Assembly
Apache.Arrow.dll

The DelegatingArrayBuilder<T, TArray, TBuilder> class can be used as the base for any array builder that needs to delegate most of its functionality to an inner array builder.

public abstract class DelegatingArrayBuilder<T, TArray, TBuilder> : IArrowArrayBuilder<TArray, TBuilder>, IArrowArrayBuilder<TArray>, IArrowArrayBuilder where TArray : IArrowArray where TBuilder : class, IArrowArrayBuilder<TArray>

Type Parameters

T

Type of item accepted by inner array builder.

TArray

Type of array produced by this (and the inner) builder.

TBuilder

Type of builder (see Curiously-Recurring Template Pattern).

Inheritance
DelegatingArrayBuilder<T, TArray, TBuilder>
Implements
IArrowArrayBuilder<TArray, TBuilder>
Derived
Inherited Members

Remarks

The typical use case is when an array builder may accept a number of different types as input, but which are all internally converted to a single type for assembly into an array.

Constructors

DelegatingArrayBuilder(IArrowArrayBuilder<T, TArray, IArrowArrayBuilder<TArray>>)

Construct a new instance of the DelegatingArrayBuilder<T, TArray, TBuilder> class.

protected DelegatingArrayBuilder(IArrowArrayBuilder<T, TArray, IArrowArrayBuilder<TArray>> innerBuilder)

Parameters

innerBuilder IArrowArrayBuilder<T, TArray, IArrowArrayBuilder<TArray>>

Inner array builder.

Properties

InnerBuilder

Gets the inner array builder.

protected IArrowArrayBuilder<T, TArray, IArrowArrayBuilder<TArray>> InnerBuilder { get; }

Property Value

IArrowArrayBuilder<T, TArray, IArrowArrayBuilder<TArray>>

Length

Gets the number of items added to the array so far.

public int Length { get; }

Property Value

int

Methods

AppendNull()

Appends a null value

public abstract TBuilder AppendNull()

Returns

TBuilder

Returns the builder (for fluent-style composition).

Build(MemoryAllocator)

Build an Arrow Array from the appended contents so far.

public TArray Build(MemoryAllocator allocator = null)

Parameters

allocator MemoryAllocator

Optional memory allocator.

Returns

TArray

Returns the built array.

Clear()

Clear all contents appended so far.

public TBuilder Clear()

Returns

TBuilder

Returns the builder (for fluent-style composition).

Reserve(int)

Reserve a given number of items' additional capacity.

public TBuilder Reserve(int additionalCapacity)

Parameters

additionalCapacity int

Number of items of required additional capacity.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Resize(int)

Resize the array to a given size.

public TBuilder Resize(int capacity)

Parameters

capacity int

Number of items of required capacity.

Returns

TBuilder

Returns the builder (for fluent-style composition).

Remarks

Note that if the required capacity is larger than the current length of the populated array so far, the array's contents in the new, expanded region are undefined.