array

package
v0.135.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IntType     = arrow.PrimitiveTypes.Int64
	UintType    = arrow.PrimitiveTypes.Uint64
	FloatType   = arrow.PrimitiveTypes.Float64
	StringType  = arrow.BinaryTypes.String
	BooleanType = arrow.FixedWidthTypes.Boolean
)

Functions

This section is empty.

Types

type Boolean

type Boolean = array.Boolean

func BooleanRepeat added in v0.125.0

func BooleanRepeat(v bool, isNull bool, n int, mem memory.Allocator) *Boolean

type BooleanBuilder

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

func NewBooleanBuilder added in v0.125.0

func NewBooleanBuilder(mem memory.Allocator) *BooleanBuilder

func (*BooleanBuilder) Append

func (b *BooleanBuilder) Append(v bool)

func (*BooleanBuilder) AppendNull added in v0.125.0

func (b *BooleanBuilder) AppendNull()

func (*BooleanBuilder) AppendValues

func (b *BooleanBuilder) AppendValues(v []bool, valid []bool)

func (*BooleanBuilder) Cap added in v0.125.0

func (b *BooleanBuilder) Cap() int

func (*BooleanBuilder) Len added in v0.125.0

func (b *BooleanBuilder) Len() int

func (*BooleanBuilder) NewArray added in v0.125.0

func (b *BooleanBuilder) NewArray() Interface

func (*BooleanBuilder) NewBooleanArray added in v0.125.0

func (b *BooleanBuilder) NewBooleanArray() *Boolean

func (*BooleanBuilder) NullN added in v0.125.0

func (b *BooleanBuilder) NullN() int

func (*BooleanBuilder) Release added in v0.125.0

func (b *BooleanBuilder) Release()

func (*BooleanBuilder) Reserve added in v0.125.0

func (b *BooleanBuilder) Reserve(n int)

func (*BooleanBuilder) Resize added in v0.125.0

func (b *BooleanBuilder) Resize(n int)

func (*BooleanBuilder) Retain added in v0.125.0

func (b *BooleanBuilder) Retain()

func (*BooleanBuilder) UnsafeAppend added in v0.125.0

func (b *BooleanBuilder) UnsafeAppend(v bool)

func (*BooleanBuilder) UnsafeAppendBoolToBitmap added in v0.125.0

func (b *BooleanBuilder) UnsafeAppendBoolToBitmap(isValid bool)

type Builder added in v0.125.0

type Builder interface {
	// Retain increases the reference count by 1.
	// Retain may be called simultaneously from multiple goroutines.
	Retain()

	// Release decreases the reference count by 1.
	Release()

	// Len returns the number of elements in the array builder.
	Len() int

	// Cap returns the total number of elements that can be stored
	// without allocating additional memory.
	Cap() int

	// NullN returns the number of null values in the array builder.
	NullN() int

	// AppendNull adds a new null value to the array being built.
	AppendNull()

	// Reserve ensures there is enough space for appending n elements
	// by checking the capacity and calling Resize if necessary.
	Reserve(n int)

	// Resize adjusts the space allocated by b to n elements. If n is greater than b.Cap(),
	// additional memory will be allocated. If n is smaller, the allocated memory may reduced.
	Resize(n int)

	// NewArray creates a new array from the memory buffers used
	// by the builder and resets the Builder so it can be used to build
	// a new array.
	NewArray() Interface
}

Builder provides an interface to build arrow arrays.

This type is derived from the arrow array.Builder interface.

type DataType added in v0.125.0

type DataType = arrow.DataType

type Float

type Float = array.Float64

func FloatRepeat added in v0.125.0

func FloatRepeat(v float64, isNull bool, n int, mem memory.Allocator) *Float

type FloatBuilder

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

func NewFloatBuilder added in v0.125.0

func NewFloatBuilder(mem memory.Allocator) *FloatBuilder

func (*FloatBuilder) Append

func (b *FloatBuilder) Append(v float64)

func (*FloatBuilder) AppendNull added in v0.125.0

func (b *FloatBuilder) AppendNull()

func (*FloatBuilder) AppendValues

func (b *FloatBuilder) AppendValues(v []float64, valid []bool)

func (*FloatBuilder) Cap added in v0.125.0

func (b *FloatBuilder) Cap() int

func (*FloatBuilder) Len added in v0.125.0

func (b *FloatBuilder) Len() int

func (*FloatBuilder) NewArray added in v0.125.0

func (b *FloatBuilder) NewArray() Interface

func (*FloatBuilder) NewFloatArray added in v0.125.0

func (b *FloatBuilder) NewFloatArray() *Float

func (*FloatBuilder) NullN added in v0.125.0

func (b *FloatBuilder) NullN() int

func (*FloatBuilder) Release added in v0.125.0

func (b *FloatBuilder) Release()

func (*FloatBuilder) Reserve added in v0.125.0

func (b *FloatBuilder) Reserve(n int)

func (*FloatBuilder) Resize added in v0.125.0

func (b *FloatBuilder) Resize(n int)

func (*FloatBuilder) Retain added in v0.125.0

func (b *FloatBuilder) Retain()

func (*FloatBuilder) UnsafeAppend added in v0.125.0

func (b *FloatBuilder) UnsafeAppend(v float64)

func (*FloatBuilder) UnsafeAppendBoolToBitmap added in v0.125.0

func (b *FloatBuilder) UnsafeAppendBoolToBitmap(isValid bool)

type Int

type Int = array.Int64

func IntRepeat added in v0.125.0

func IntRepeat(v int64, isNull bool, n int, mem memory.Allocator) *Int

type IntBuilder

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

func NewIntBuilder added in v0.125.0

func NewIntBuilder(mem memory.Allocator) *IntBuilder

func (*IntBuilder) Append

func (b *IntBuilder) Append(v int64)

func (*IntBuilder) AppendNull added in v0.125.0

func (b *IntBuilder) AppendNull()

func (*IntBuilder) AppendValues

func (b *IntBuilder) AppendValues(v []int64, valid []bool)

func (*IntBuilder) Cap added in v0.125.0

func (b *IntBuilder) Cap() int

func (*IntBuilder) Len added in v0.125.0

func (b *IntBuilder) Len() int

func (*IntBuilder) NewArray added in v0.125.0

func (b *IntBuilder) NewArray() Interface

func (*IntBuilder) NewIntArray added in v0.125.0

func (b *IntBuilder) NewIntArray() *Int

func (*IntBuilder) NullN added in v0.125.0

func (b *IntBuilder) NullN() int

func (*IntBuilder) Release added in v0.125.0

func (b *IntBuilder) Release()

func (*IntBuilder) Reserve added in v0.125.0

func (b *IntBuilder) Reserve(n int)

func (*IntBuilder) Resize added in v0.125.0

func (b *IntBuilder) Resize(n int)

func (*IntBuilder) Retain added in v0.125.0

func (b *IntBuilder) Retain()

func (*IntBuilder) UnsafeAppend added in v0.125.0

func (b *IntBuilder) UnsafeAppend(v int64)

func (*IntBuilder) UnsafeAppendBoolToBitmap added in v0.125.0

func (b *IntBuilder) UnsafeAppendBoolToBitmap(isValid bool)

type Interface added in v0.125.0

type Interface interface {
	// DataType returns the type metadata for this instance.
	DataType() DataType

	// NullN returns the number of null values in the array.
	NullN() int

	// NullBitmapBytes returns a byte slice of the validity bitmap.
	NullBitmapBytes() []byte

	// IsNull returns true if value at index is null.
	// NOTE: IsNull will panic if NullBitmapBytes is not empty and 0 > i ≥ Len.
	IsNull(i int) bool

	// IsValid returns true if value at index is not null.
	// NOTE: IsValid will panic if NullBitmapBytes is not empty and 0 > i ≥ Len.
	IsValid(i int) bool

	// Len returns the number of elements in the array.
	Len() int

	// Retain increases the reference count by 1.
	// Retain may be called simultaneously from multiple goroutines.
	Retain()

	// Release decreases the reference count by 1.
	// Release may be called simultaneously from multiple goroutines.
	// When the reference count goes to zero, the memory is freed.
	Release()
}

Interface represents an immutable sequence of values.

This type is derived from the arrow array.Interface interface.

func Slice added in v0.125.0

func Slice(arr Interface, i, j int) Interface

Slice will construct a new slice of the array using the given start and stop index. The returned array must be released.

This is functionally equivalent to using array.NewSlice, but array.NewSlice will construct an array.String when the data type is a string rather than an array.Binary.

type String

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

func StringRepeat added in v0.125.0

func StringRepeat(v string, n int, mem memory.Allocator) *String

func (*String) DataType added in v0.125.0

func (a *String) DataType() DataType

func (*String) IsNull added in v0.125.0

func (a *String) IsNull(i int) bool

func (*String) IsValid added in v0.125.0

func (a *String) IsValid(i int) bool

func (*String) Len added in v0.125.0

func (a *String) Len() int

func (*String) NullBitmapBytes added in v0.125.0

func (a *String) NullBitmapBytes() []byte

func (*String) NullN added in v0.125.0

func (a *String) NullN() int

func (*String) Release added in v0.125.0

func (a *String) Release()

func (*String) Retain added in v0.125.0

func (a *String) Retain()

func (*String) Slice added in v0.125.0

func (a *String) Slice(i, j int) Interface

func (*String) Value

func (a *String) Value(i int) string

func (*String) ValueLen added in v0.125.0

func (a *String) ValueLen(i int) int

type StringBuilder

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

func NewStringBuilder added in v0.125.0

func NewStringBuilder(mem memory.Allocator) *StringBuilder

func (*StringBuilder) Append

func (b *StringBuilder) Append(v string)

func (*StringBuilder) AppendNull added in v0.125.0

func (b *StringBuilder) AppendNull()

func (*StringBuilder) AppendValues

func (b *StringBuilder) AppendValues(v []string, valid []bool)

func (*StringBuilder) Cap added in v0.125.0

func (b *StringBuilder) Cap() int

func (*StringBuilder) Len added in v0.125.0

func (b *StringBuilder) Len() int

func (*StringBuilder) NewArray added in v0.125.0

func (b *StringBuilder) NewArray() Interface

func (*StringBuilder) NewStringArray added in v0.125.0

func (b *StringBuilder) NewStringArray() *String

func (*StringBuilder) NullN added in v0.125.0

func (b *StringBuilder) NullN() int

func (*StringBuilder) Release added in v0.125.0

func (b *StringBuilder) Release()

func (*StringBuilder) Reserve added in v0.125.0

func (b *StringBuilder) Reserve(n int)

func (*StringBuilder) ReserveData added in v0.125.0

func (b *StringBuilder) ReserveData(n int)

func (*StringBuilder) Resize added in v0.125.0

func (b *StringBuilder) Resize(n int)

func (*StringBuilder) Retain added in v0.125.0

func (b *StringBuilder) Retain()

func (*StringBuilder) UnsafeAppendBoolToBitmap added in v0.125.0

func (b *StringBuilder) UnsafeAppendBoolToBitmap(isValid bool)

type Uint added in v0.125.0

type Uint = array.Uint64

func UintRepeat added in v0.125.0

func UintRepeat(v uint64, isNull bool, n int, mem memory.Allocator) *Uint

type UintBuilder added in v0.125.0

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

func NewUintBuilder added in v0.125.0

func NewUintBuilder(mem memory.Allocator) *UintBuilder

func (*UintBuilder) Append added in v0.125.0

func (b *UintBuilder) Append(v uint64)

func (*UintBuilder) AppendNull added in v0.125.0

func (b *UintBuilder) AppendNull()

func (*UintBuilder) AppendValues added in v0.125.0

func (b *UintBuilder) AppendValues(v []uint64, valid []bool)

func (*UintBuilder) Cap added in v0.125.0

func (b *UintBuilder) Cap() int

func (*UintBuilder) Len added in v0.125.0

func (b *UintBuilder) Len() int

func (*UintBuilder) NewArray added in v0.125.0

func (b *UintBuilder) NewArray() Interface

func (*UintBuilder) NewUintArray added in v0.125.0

func (b *UintBuilder) NewUintArray() *Uint

func (*UintBuilder) NullN added in v0.125.0

func (b *UintBuilder) NullN() int

func (*UintBuilder) Release added in v0.125.0

func (b *UintBuilder) Release()

func (*UintBuilder) Reserve added in v0.125.0

func (b *UintBuilder) Reserve(n int)

func (*UintBuilder) Resize added in v0.125.0

func (b *UintBuilder) Resize(n int)

func (*UintBuilder) Retain added in v0.125.0

func (b *UintBuilder) Retain()

func (*UintBuilder) UnsafeAppend added in v0.125.0

func (b *UintBuilder) UnsafeAppend(v uint64)

func (*UintBuilder) UnsafeAppendBoolToBitmap added in v0.125.0

func (b *UintBuilder) UnsafeAppendBoolToBitmap(isValid bool)

Jump to

Keyboard shortcuts

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