vector

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindInvalid = 0
	KindInt     = 1
	KindUint    = 2
	KindFloat   = 3
	KindString  = 4
	KindBytes   = 5
	KindType    = 6
)
View Source
const (
	FormFlat  = 0
	FormDict  = 1
	FormView  = 2
	FormConst = 3
)
View Source
const (
	CompLT = 0
	CompLE = 1
	CompGT = 2
	CompGE = 3
	CompEQ = 4
	CompNE = 6
)
View Source
const (
	ArithAdd = iota
	ArithSub
	ArithMul
	ArithDiv
	ArithMod
)

Variables

This section is empty.

Functions

func ArithOpFromString added in v1.17.0

func ArithOpFromString(op string) int

func BoolValue added in v1.18.0

func BoolValue(vec Any, slot uint32) bool

BoolValue returns the value of slot in vec if the value is a Boolean. It returns false otherwise.

func BytesValue added in v1.18.0

func BytesValue(val Any, slot uint32) ([]byte, bool)

func CompareOpFromString added in v1.16.0

func CompareOpFromString(op string) int

func ContainerOffset added in v1.18.0

func ContainerOffset(val Any, slot uint32) (uint32, uint32, bool)

func FuncCode added in v1.17.0

func FuncCode(op int, kind Kind, lform, rform Form) int

func IPValue added in v1.18.0

func IPValue(val Any, slot uint32) (netip.Addr, bool)

func IntValue added in v1.18.0

func IntValue(vec Any, slot uint32) (int64, bool)

func NetValue added in v1.18.0

func NetValue(val Any, slot uint32) (netip.Prefix, bool)

func StringValue added in v1.18.0

func StringValue(val Any, slot uint32) (string, bool)

func TypeValueValue added in v1.18.0

func TypeValueValue(val Any, slot uint32) ([]byte, bool)

Types

type Any added in v1.12.0

type Any interface {
	Type() zed.Type
	Len() uint32
	Serialize(*zcode.Builder, uint32)
}

func Apply added in v1.18.0

func Apply(ripUnions bool, eval func(...Any) Any, vecs ...Any) Any

Apply applies eval to vecs. If any element of vecs is a Variant, Apply rips vecs accordingly, applies eval to the ripped vectors, and stitches the results together into a Variant. If ripUnions is true, Apply also rips Unions.

func Combine added in v1.18.0

func Combine(vec Any, index []uint32, add Any) Any

func Deunion added in v1.18.0

func Deunion(vec Any) Any

func Inner added in v1.18.0

func Inner(val Any) Any

func NewNamed added in v1.13.0

func NewNamed(typ *zed.TypeNamed, v Any) Any

func NewView added in v1.18.0

func NewView(index []uint32, val Any) Any

func Under added in v1.14.0

func Under(v Any) Any

type Array added in v1.12.0

type Array struct {
	Typ     *zed.TypeArray
	Offsets []uint32
	Values  Any
	Nulls   *Bool
}

func NewArray added in v1.12.0

func NewArray(typ *zed.TypeArray, offsets []uint32, values Any, nulls *Bool) *Array

func (*Array) Len added in v1.13.0

func (a *Array) Len() uint32

func (*Array) Serialize added in v1.13.0

func (a *Array) Serialize(b *zcode.Builder, slot uint32)

func (*Array) Type added in v1.12.0

func (a *Array) Type() zed.Type

type Bool added in v1.12.0

type Bool struct {
	Bits  []uint64
	Nulls *Bool
	// contains filtered or unexported fields
}

func NewBool added in v1.12.0

func NewBool(bits []uint64, len uint32, nulls *Bool) *Bool

func NewBoolEmpty added in v1.13.0

func NewBoolEmpty(length uint32, nulls *Bool) *Bool

func (*Bool) CopyWithBits added in v1.14.0

func (b *Bool) CopyWithBits(bits []uint64) *Bool

func (*Bool) Len added in v1.13.0

func (b *Bool) Len() uint32

func (*Bool) Serialize added in v1.13.0

func (b *Bool) Serialize(builder *zcode.Builder, slot uint32)

func (*Bool) Set added in v1.13.0

func (b *Bool) Set(slot uint32)

func (*Bool) String added in v1.13.0

func (b *Bool) String() string

helpful to have around for debugging

func (*Bool) Type added in v1.12.0

func (b *Bool) Type() zed.Type

func (*Bool) Value added in v1.13.0

func (b *Bool) Value(slot uint32) bool

type Builder added in v1.12.0

type Builder func(*zcode.Builder) bool

type Bytes added in v1.13.0

type Bytes struct {
	Offs  []uint32
	Bytes []byte
	Nulls *Bool
}

func NewBytes added in v1.13.0

func NewBytes(offs []uint32, bytes []byte, nulls *Bool) *Bytes

func NewBytesEmpty added in v1.18.0

func NewBytesEmpty(length uint32, nulls *Bool) *Bytes

func (*Bytes) Append added in v1.18.0

func (b *Bytes) Append(v []byte)

func (*Bytes) Len added in v1.13.0

func (b *Bytes) Len() uint32

func (*Bytes) Serialize added in v1.13.0

func (b *Bytes) Serialize(builder *zcode.Builder, slot uint32)

func (*Bytes) Type added in v1.13.0

func (b *Bytes) Type() zed.Type

func (*Bytes) Value added in v1.16.0

func (b *Bytes) Value(slot uint32) []byte

type Const added in v1.12.0

type Const struct {
	Nulls *Bool
	// contains filtered or unexported fields
}

func NewConst added in v1.12.0

func NewConst(val zed.Value, len uint32, nulls *Bool) *Const

func (*Const) AsBytes added in v1.16.0

func (c *Const) AsBytes() ([]byte, bool)

func (*Const) AsFloat added in v1.14.0

func (c *Const) AsFloat() (float64, bool)

func (*Const) AsInt added in v1.14.0

func (c *Const) AsInt() (int64, bool)

func (*Const) AsString added in v1.16.0

func (c *Const) AsString() (string, bool)

func (*Const) AsUint added in v1.14.0

func (c *Const) AsUint() (uint64, bool)

func (*Const) Len added in v1.13.0

func (c *Const) Len() uint32

func (*Const) Length added in v1.12.0

func (c *Const) Length() int

func (*Const) Ref added in v1.12.0

func (*Const) Ref()

func (*Const) Serialize added in v1.13.0

func (c *Const) Serialize(b *zcode.Builder, slot uint32)

func (*Const) Type added in v1.12.0

func (c *Const) Type() zed.Type

func (*Const) Unref added in v1.12.0

func (*Const) Unref()

func (*Const) Value added in v1.12.0

func (c *Const) Value() zed.Value

type Dict added in v1.16.0

type Dict struct {
	Any
	Index  []byte
	Counts []uint32
	Nulls  *Bool
}

func NewDict added in v1.16.0

func NewDict(vals Any, index []byte, counts []uint32, nulls *Bool) *Dict

func (*Dict) Len added in v1.16.0

func (d *Dict) Len() uint32

func (*Dict) Serialize added in v1.16.0

func (d *Dict) Serialize(builder *zcode.Builder, slot uint32)

type Error added in v1.13.0

type Error struct {
	Typ   *zed.TypeError
	Vals  Any
	Nulls *Bool
}

func NewError added in v1.13.0

func NewError(typ *zed.TypeError, vals Any, nulls *Bool) *Error

XXX we shouldn't create empty fields... this was the old design, now we create the entire vector structure and page in leaves, offsets, etc on demand

func NewMissing added in v1.13.0

func NewMissing(zctx *zed.Context, len uint32) *Error

func NewStringError added in v1.14.0

func NewStringError(zctx *zed.Context, msg string, len uint32) *Error

func NewWrappedError added in v1.18.0

func NewWrappedError(zctx *zed.Context, msg string, val Any) *Error

func (*Error) Len added in v1.13.0

func (e *Error) Len() uint32

func (*Error) Serialize added in v1.13.0

func (e *Error) Serialize(b *zcode.Builder, slot uint32)

func (*Error) Type added in v1.13.0

func (e *Error) Type() zed.Type

type Float added in v1.13.0

type Float struct {
	Typ    zed.Type
	Values []float64
	Nulls  *Bool
}

func NewFloat added in v1.13.0

func NewFloat(typ zed.Type, values []float64, nulls *Bool) *Float

func NewFloatEmpty added in v1.17.0

func NewFloatEmpty(typ zed.Type, length uint32, nulls *Bool) *Float

func (*Float) Append added in v1.17.0

func (f *Float) Append(v float64)

func (*Float) Len added in v1.13.0

func (f *Float) Len() uint32

func (*Float) Serialize added in v1.13.0

func (f *Float) Serialize(b *zcode.Builder, slot uint32)

func (*Float) Type added in v1.13.0

func (f *Float) Type() zed.Type

func (*Float) Value added in v1.17.0

func (f *Float) Value(slot uint32) float64

type Form added in v1.16.0

type Form int

func FormOf added in v1.16.0

func FormOf(v Any) (Form, bool)

func (Form) String added in v1.16.0

func (f Form) String() string

type IP added in v1.13.0

type IP struct {
	Values []netip.Addr
	Nulls  *Bool
}

func NewIP added in v1.13.0

func NewIP(values []netip.Addr, nulls *Bool) *IP

func (*IP) Len added in v1.13.0

func (i *IP) Len() uint32

func (*IP) Serialize added in v1.13.0

func (i *IP) Serialize(b *zcode.Builder, slot uint32)

func (*IP) Type added in v1.13.0

func (i *IP) Type() zed.Type

type Int added in v1.12.0

type Int struct {
	Typ    zed.Type
	Values []int64
	Nulls  *Bool
}

func NewInt added in v1.12.0

func NewInt(typ zed.Type, values []int64, nulls *Bool) *Int

func NewIntEmpty added in v1.17.0

func NewIntEmpty(typ zed.Type, length uint32, nulls *Bool) *Int

func (*Int) Append added in v1.17.0

func (i *Int) Append(v int64)

func (*Int) Len added in v1.13.0

func (i *Int) Len() uint32

func (*Int) Promote added in v1.14.0

func (i *Int) Promote(typ zed.Type) Promotable

func (*Int) Serialize added in v1.13.0

func (i *Int) Serialize(b *zcode.Builder, slot uint32)

func (*Int) Type added in v1.12.0

func (i *Int) Type() zed.Type

func (*Int) Value added in v1.17.0

func (i *Int) Value(slot uint32) int64

type Kind added in v1.16.0

type Kind int

func KindFromString added in v1.16.0

func KindFromString(v string) Kind

func KindOf added in v1.16.0

func KindOf(v Any) Kind

func KindOfType added in v1.16.0

func KindOfType(typ zed.Type) Kind

type Map added in v1.12.0

type Map struct {
	Typ     *zed.TypeMap
	Offsets []uint32
	Keys    Any
	Values  Any
	Nulls   *Bool
}

func NewMap added in v1.12.0

func NewMap(typ *zed.TypeMap, offsets []uint32, keys Any, values Any, nulls *Bool) *Map

func (*Map) Len added in v1.13.0

func (m *Map) Len() uint32

func (*Map) Serialize added in v1.13.0

func (m *Map) Serialize(b *zcode.Builder, slot uint32)

func (*Map) Type added in v1.12.0

func (m *Map) Type() zed.Type

type Named added in v1.13.0

type Named struct {
	Typ *zed.TypeNamed
	Any
}

func (*Named) Type added in v1.13.0

func (n *Named) Type() zed.Type

type Net added in v1.13.0

type Net struct {
	Values []netip.Prefix
	Nulls  *Bool
}

func NewNet added in v1.13.0

func NewNet(values []netip.Prefix, nulls *Bool) *Net

func (*Net) Len added in v1.13.0

func (n *Net) Len() uint32

func (*Net) Serialize added in v1.13.0

func (n *Net) Serialize(b *zcode.Builder, slot uint32)

func (*Net) Type added in v1.13.0

func (n *Net) Type() zed.Type

type Promotable added in v1.16.0

type Promotable interface {
	Any
	Promote(zed.Type) Promotable
}

type Puller added in v1.13.0

type Puller interface {
	Pull(done bool) (Any, error)
}

type Record added in v1.12.0

type Record struct {
	Typ    *zed.TypeRecord
	Fields []Any

	Nulls *Bool
	// contains filtered or unexported fields
}

func NewRecord added in v1.12.0

func NewRecord(typ *zed.TypeRecord, fields []Any, length uint32, nulls *Bool) *Record

func (*Record) Len added in v1.13.0

func (r *Record) Len() uint32

func (*Record) Serialize added in v1.13.0

func (r *Record) Serialize(b *zcode.Builder, slot uint32)

func (*Record) Type added in v1.12.0

func (r *Record) Type() zed.Type

type Set added in v1.13.0

type Set struct {
	Typ     *zed.TypeSet
	Offsets []uint32
	Values  Any
	Nulls   *Bool
}

func NewSet added in v1.13.0

func NewSet(typ *zed.TypeSet, offsets []uint32, values Any, nulls *Bool) *Set

func (*Set) Len added in v1.13.0

func (s *Set) Len() uint32

func (*Set) Serialize added in v1.13.0

func (s *Set) Serialize(b *zcode.Builder, slot uint32)

func (*Set) Type added in v1.13.0

func (s *Set) Type() zed.Type

type String added in v1.12.0

type String struct {
	Offsets []uint32
	Bytes   []byte
	Nulls   *Bool
}

func NewString added in v1.12.0

func NewString(offsets []uint32, bytes []byte, nulls *Bool) *String

func NewStringEmpty added in v1.17.0

func NewStringEmpty(length uint32, nulls *Bool) *String

func (*String) Append added in v1.17.0

func (s *String) Append(v string)

func (*String) Len added in v1.13.0

func (s *String) Len() uint32

func (*String) Serialize added in v1.13.0

func (s *String) Serialize(b *zcode.Builder, slot uint32)

func (*String) Type added in v1.12.0

func (s *String) Type() zed.Type

func (*String) Value added in v1.13.0

func (s *String) Value(slot uint32) string

type TagMap added in v1.13.0

type TagMap struct {
	Forward []uint32
	Reverse [][]uint32
}

TagMap is used by variants and unions to map slots between parent and child in both the forward and reverse directions. We need this because vectors are stored in a dense format where different types hold only the values needed for that type. If we stored vectors in a sparse format, the amount of overhead would increase substantially for heterogeneously typed data.

func NewTagMap added in v1.13.0

func NewTagMap(tags []uint32, vals []Any) *TagMap

func NewTagMapFromLens added in v1.13.0

func NewTagMapFromLens(tags []uint32, lens []uint32) *TagMap

type TypeValue added in v1.13.0

type TypeValue struct {
	Offsets []uint32
	Bytes   []byte
	Nulls   *Bool
}

func NewTypeValue added in v1.13.0

func NewTypeValue(offs []uint32, bytes []byte, nulls *Bool) *TypeValue

func (*TypeValue) Len added in v1.13.0

func (t *TypeValue) Len() uint32

func (*TypeValue) Serialize added in v1.13.0

func (t *TypeValue) Serialize(b *zcode.Builder, slot uint32)

func (*TypeValue) Type added in v1.13.0

func (t *TypeValue) Type() zed.Type

func (*TypeValue) Value added in v1.13.0

func (t *TypeValue) Value(slot uint32) []byte

type Uint added in v1.12.0

type Uint struct {
	Typ    zed.Type
	Values []uint64
	Nulls  *Bool
}

func NewUint added in v1.12.0

func NewUint(typ zed.Type, values []uint64, nulls *Bool) *Uint

func NewUintEmpty added in v1.17.0

func NewUintEmpty(typ zed.Type, length uint32, nulls *Bool) *Uint

func (*Uint) Append added in v1.17.0

func (u *Uint) Append(v uint64)

func (*Uint) Len added in v1.13.0

func (u *Uint) Len() uint32

func (*Uint) Promote added in v1.14.0

func (u *Uint) Promote(typ zed.Type) Promotable

func (*Uint) Serialize added in v1.13.0

func (u *Uint) Serialize(b *zcode.Builder, slot uint32)

func (*Uint) Type added in v1.12.0

func (u *Uint) Type() zed.Type

func (*Uint) Value added in v1.17.0

func (u *Uint) Value(slot uint32) uint64

type Union added in v1.12.0

type Union struct {
	*Variant
	Typ   *zed.TypeUnion
	Nulls *Bool
}

func NewUnion added in v1.12.0

func NewUnion(typ *zed.TypeUnion, tags []uint32, vals []Any, nulls *Bool) *Union

func (*Union) Serialize added in v1.13.0

func (u *Union) Serialize(b *zcode.Builder, slot uint32)

func (*Union) Type added in v1.12.0

func (u *Union) Type() zed.Type

type Variant added in v1.13.0

type Variant struct {
	Tags   []uint32
	Values []Any
	TagMap *TagMap
}

Variant is an ordered sequence of values taken from one or more hetereogenously-typed vectors.

func NewVariant added in v1.13.0

func NewVariant(tags []uint32, values []Any) *Variant

func (*Variant) Len added in v1.13.0

func (v *Variant) Len() uint32

func (*Variant) Serialize added in v1.13.0

func (v *Variant) Serialize(b *zcode.Builder, slot uint32)

func (*Variant) Type added in v1.13.0

func (v *Variant) Type() zed.Type

func (*Variant) TypeOf added in v1.13.0

func (v *Variant) TypeOf(slot uint32) zed.Type

type View added in v1.18.0

type View struct {
	Any
	Index []uint32
}

func (*View) Len added in v1.18.0

func (v *View) Len() uint32

func (*View) Serialize added in v1.18.0

func (v *View) Serialize(b *zcode.Builder, slot uint32)

Jump to

Keyboard shortcuts

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