builder

package
v0.0.0-...-b4d2799 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package builder privides builders for various Arrow data types, such as uint16, string, float64, binary, map, and fixed-size binary etc. Each builder includes methods to append values, append nulls, and retrieve the length of the data appended.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryBuilder

type BinaryBuilder struct {
	// contains filtered or unexported fields
}

BinaryBuilder represents a builder for binary data.

func (*BinaryBuilder) Append

func (bb *BinaryBuilder) Append(value []byte)

Append appends a binary value to the builder.

func (*BinaryBuilder) AppendNull

func (bb *BinaryBuilder) AppendNull()

AppendNull appends a null value to the builder.

func (*BinaryBuilder) Len

func (bb *BinaryBuilder) Len() int

Len returns the number of values appended to the builder.

type Builder

type Builder interface {
	// Append appends a value to the builder.
	AppendNull()
	// Len returns the number of values appended to the builder.
	Len() int
}

Builder defines the common interface for all builders.

type DurationBuilder

type DurationBuilder struct {
	// contains filtered or unexported fields
}

DurationBuilder represents a wrapper for duration data.

func (*DurationBuilder) Append

func (db *DurationBuilder) Append(value int64)

Append appends a duration value to the builder.

func (*DurationBuilder) AppendNull

func (db *DurationBuilder) AppendNull()

AppendNull appends a null value to the builder.

func (*DurationBuilder) Len

func (db *DurationBuilder) Len() int

Len returns the number of values currently in the builder.

type FixedSizeBinaryBuilder

type FixedSizeBinaryBuilder struct {
	// contains filtered or unexported fields
}

func (*FixedSizeBinaryBuilder) Append

func (fsbb *FixedSizeBinaryBuilder) Append(value []byte)

Append appends a fixed-size binary value to the builder.

func (*FixedSizeBinaryBuilder) AppendNull

func (fsbb *FixedSizeBinaryBuilder) AppendNull()

AppendNull appends a null value to the builder.

func (*FixedSizeBinaryBuilder) Len

func (fsbb *FixedSizeBinaryBuilder) Len() int

Len returns the number of values appended to the builder.

type Float64Builder

type Float64Builder struct {
	// contains filtered or unexported fields
}

Float64Builder represents a builder for float64 data.

func (*Float64Builder) Append

func (fb *Float64Builder) Append(value float64)

Append appends a float64 value to the builder.

func (*Float64Builder) AppendNull

func (fb *Float64Builder) AppendNull()

AppendNull appends a null value to the builder.

func (*Float64Builder) Len

func (fb *Float64Builder) Len() int

Len returns the number of values appended to the builder.

type Int64Builder

type Int64Builder struct {
	// contains filtered or unexported fields
}

Int64Builder represents a wrapper for int64 data.

func (*Int64Builder) Append

func (ib *Int64Builder) Append(value int64)

Append appends a int64 value to the builder.

func (*Int64Builder) AppendNull

func (ib *Int64Builder) AppendNull()

AppendNull appends a null value to the builder.

func (*Int64Builder) Len

func (ib *Int64Builder) Len() int

Len returns the number of values currently in the builder.

type ListBuilder

type ListBuilder struct {
	// contains filtered or unexported fields
}

ListBuilder represents a builder for list data.

func (*ListBuilder) Append

func (lb *ListBuilder) Append(numOfItems int, appender func())

Append appends a list value to the builder.

func (*ListBuilder) AppendNull

func (lb *ListBuilder) AppendNull()

AppendNull appends a null value to the builder.

func (*ListBuilder) Len

func (lb *ListBuilder) Len() int

Len returns the number of values appended to the builder.

func (*ListBuilder) Reserve

func (lb *ListBuilder) Reserve(numOfItems int)

Reserve reserves space for the specified number of items in the builder.

func (*ListBuilder) Uint16Builder

func (lb *ListBuilder) Uint16Builder() *Uint16Builder

Uint16Builder returns a builder for uint16 values within the list.

type MapBuilder

type MapBuilder struct {
	// contains filtered or unexported fields
}

MapBuilder represents a builder for map data.

func (*MapBuilder) Append

func (mb *MapBuilder) Append(mapLen int, appender func())

Append appends a map value to the builder using the provided appender function.

func (*MapBuilder) AppendNull

func (mb *MapBuilder) AppendNull()

AppendNull appends a null value to the builder.

func (*MapBuilder) ItemStringBuilder

func (mb *MapBuilder) ItemStringBuilder() *StringBuilder

ItemStringBuilder returns a StringBuilder for appending item values to the map builder.

func (*MapBuilder) KeyStringBuilder

func (mb *MapBuilder) KeyStringBuilder() *StringBuilder

KeyStringBuilder returns a StringBuilder for appending key values to the map builder.

func (*MapBuilder) Len

func (mb *MapBuilder) Len() int

Len returns the number of map values appended to the builder.

func (*MapBuilder) Reserve

func (mb *MapBuilder) Reserve(mapLen int)

Reserve reserves space for a map value with the specified length.

type RecordBuilder

type RecordBuilder struct {
	// contains filtered or unexported fields
}

RecordBuilder represents a wrapper for arrow RecordBuilder.

func NewRecordBuilder

func NewRecordBuilder(allocator memory.Allocator, schema *arrow.Schema) *RecordBuilder

NewRecordBuilder creates a new RecordBuilder for the given schema.

func (*RecordBuilder) BinaryBuilder

func (rb *RecordBuilder) BinaryBuilder(name string) *array.BinaryBuilder

BinaryBuilder returns a BinaryBuilder for the specified field name.

func (*RecordBuilder) DurationBuilder

func (rb *RecordBuilder) DurationBuilder(name string) *array.DurationBuilder

DurationBuilder returns a DurationBuilder for the specified field name.

func (*RecordBuilder) Fields

func (rb *RecordBuilder) Fields() []array.Builder

Fields returns the fields of the schema associated with the RecordBuilder.

func (*RecordBuilder) FixedSizeBinaryBuilder

func (rb *RecordBuilder) FixedSizeBinaryBuilder(name string) *array.FixedSizeBinaryBuilder

FixedSizeBinaryBuilder returns a FixedSizeBinaryBuilder for the specified field name.

func (*RecordBuilder) Float64Builder

func (rb *RecordBuilder) Float64Builder(name string) *array.Float64Builder

Float64Builder returns a Float64Builder for the specified field name.

func (*RecordBuilder) Int64Builder

func (rb *RecordBuilder) Int64Builder(name string) *array.Int64Builder

Int64Builder returns an Int64Builder for the specified field name.

func (*RecordBuilder) ListBuilder

func (rb *RecordBuilder) ListBuilder(name string) *array.ListBuilder

ListBuilder returns a ListBuilder for the specified field name.

func (*RecordBuilder) MapBuilder

func (rb *RecordBuilder) MapBuilder(name string) *array.MapBuilder

MapBuilder returns a MapBuilder for the specified field name.

func (*RecordBuilder) NewRecord

func (rb *RecordBuilder) NewRecord() arrow.RecordBatch

NewRecord creates a new arrow.RecordBatch from the built arrays.

func (*RecordBuilder) Release

func (rb *RecordBuilder) Release()

Release releases the resources held by the RecordBuilder.

func (*RecordBuilder) Schema

func (rb *RecordBuilder) Schema() *arrow.Schema

Schema returns the schema associated with the RecordBuilder.

func (*RecordBuilder) StringBuilder

func (rb *RecordBuilder) StringBuilder(name string) *array.StringBuilder

StringBuilder returns a StringBuilder for the specified field name.

func (*RecordBuilder) TimestampBuilder

func (rb *RecordBuilder) TimestampBuilder(name string) *array.TimestampBuilder

TimestampBuilder returns a TimestampBuilder for the specified field name.

func (*RecordBuilder) Uint16Builder

func (rb *RecordBuilder) Uint16Builder(name string) *array.Uint16Builder

Uint16Builder returns a Uint16Builder for the specified field name.

func (*RecordBuilder) Uint32Builder

func (rb *RecordBuilder) Uint32Builder(name string) *array.Uint32Builder

Uint32Builder returns a Uint32Builder for the specified field name.

type StringBuilder

type StringBuilder struct {
	// contains filtered or unexported fields
}

StringBuilder represents a builder for string data.

func (*StringBuilder) Append

func (sb *StringBuilder) Append(value string)

Append appends a string value to the builder.

func (*StringBuilder) AppendNull

func (sb *StringBuilder) AppendNull()

AppendNull appends a null value to the builder.

func (*StringBuilder) Len

func (sb *StringBuilder) Len() int

Len returns the number of values appended to the builder.

type TimestampBuilder

type TimestampBuilder struct {
	// contains filtered or unexported fields
}

TimestampBuilder represents a builder for timestamp data.

func (*TimestampBuilder) Append

func (tb *TimestampBuilder) Append(value int64)

Append appends a timestamp value to the builder.

func (*TimestampBuilder) AppendNull

func (tb *TimestampBuilder) AppendNull()

AppendNull appends a null value to the builder.

func (*TimestampBuilder) Len

func (tb *TimestampBuilder) Len() int

Len returns the number of values appended to the builder.

type Uint16Builder

type Uint16Builder struct {
	// contains filtered or unexported fields
}

Uint16Builder represents a builder for uint16 data.

func (*Uint16Builder) Append

func (b *Uint16Builder) Append(value uint16)

Append appends a uint16 value to the builder.

func (*Uint16Builder) AppendNull

func (b *Uint16Builder) AppendNull()

AppendNull appends a null value to the builder.

func (*Uint16Builder) Len

func (b *Uint16Builder) Len() int

Len returns the number of values appended to the builder.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL