array

package
Version: v0.168.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 6 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 Array added in v0.158.0

type Array 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()
}

Array represents an immutable sequence of values.

This type is derived from the arrow.Array interface.

func Slice added in v0.125.0

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

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 Boolean

type Boolean = array.Boolean

func And added in v0.168.0

func And(l, r *Boolean, mem memory.Allocator) (*Boolean, error)

func BooleanRepeat added in v0.125.0

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

func Or added in v0.168.0

func Or(l, r *Boolean, mem memory.Allocator) (*Boolean, error)

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() Array

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() Array
}

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 FloatAdd added in v0.165.0

func FloatAdd(l, r *Float, mem memory.Allocator) (*Float, error)

func FloatDiv added in v0.166.0

func FloatDiv(l, r *Float, mem memory.Allocator) (*Float, error)

func FloatMod added in v0.166.0

func FloatMod(l, r *Float, mem memory.Allocator) (*Float, error)

func FloatMul added in v0.166.0

func FloatMul(l, r *Float, mem memory.Allocator) (*Float, error)

func FloatPow added in v0.166.0

func FloatPow(l, r *Float, mem memory.Allocator) (*Float, error)

func FloatRepeat added in v0.125.0

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

func FloatSub added in v0.166.0

func FloatSub(l, r *Float, mem memory.Allocator) (*Float, error)

func IntPow added in v0.166.0

func IntPow(l, r *Int, mem memory.Allocator) (*Float, error)

func UintPow added in v0.166.0

func UintPow(l, r *Uint, mem memory.Allocator) (*Float, error)

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() Array

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 IntAdd added in v0.165.0

func IntAdd(l, r *Int, mem memory.Allocator) (*Int, error)

func IntDiv added in v0.166.0

func IntDiv(l, r *Int, mem memory.Allocator) (*Int, error)

func IntMod added in v0.166.0

func IntMod(l, r *Int, mem memory.Allocator) (*Int, error)

func IntMul added in v0.166.0

func IntMul(l, r *Int, mem memory.Allocator) (*Int, error)

func IntRepeat added in v0.125.0

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

func IntSub added in v0.166.0

func IntSub(l, r *Int, mem memory.Allocator) (*Int, error)

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() Array

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 String

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

func NewStringFromBinaryArray added in v0.150.0

func NewStringFromBinaryArray(data *array.Binary) *String

NewStringFromBinaryArray creates an instance of String from an Arrow Binary array.

Note: Generally client code should be using the types for arrays defined in Flux. This method allows string data created outside of Flux (such as from Arrow Flight) to be used in Flux.

func StringAdd added in v0.165.0

func StringAdd(l, r *String, mem memory.Allocator) (*String, error)

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) IsConstant added in v0.154.0

func (a *String) IsConstant() bool

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) Array

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() Array

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 UintAdd added in v0.165.0

func UintAdd(l, r *Uint, mem memory.Allocator) (*Uint, error)

func UintDiv added in v0.166.0

func UintDiv(l, r *Uint, mem memory.Allocator) (*Uint, error)

func UintMod added in v0.166.0

func UintMod(l, r *Uint, mem memory.Allocator) (*Uint, error)

func UintMul added in v0.166.0

func UintMul(l, r *Uint, mem memory.Allocator) (*Uint, error)

func UintRepeat added in v0.125.0

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

func UintSub added in v0.166.0

func UintSub(l, r *Uint, mem memory.Allocator) (*Uint, error)

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() Array

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