vector

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(v *Vector, arg interface{}) error

func Clean

func Clean(v *Vector, m *mheap.Mheap)

func Copy

func Copy(v, w *Vector, vi, wi int64, m *mheap.Mheap) error

v[vi] = w[wi]

func DecodeFixedCol

func DecodeFixedCol[T any](v *Vector, sz int) []T

func Free

func Free(v *Vector, m *mheap.Mheap)

func GenericVectorValues added in v0.5.0

func GenericVectorValues[T any](v *Vector) []T

func GetFixedVectorValues added in v0.5.0

func GetFixedVectorValues[T any](v *Vector, sz int) []T

func GetStrVectorValues added in v0.5.0

func GetStrVectorValues(v *Vector) ([]byte, []uint32, []uint32)

func Length

func Length(v *Vector) int

func MustBytesCols added in v0.5.0

func MustBytesCols(v *Vector) *types.Bytes

func MustTCols added in v0.5.0

func MustTCols[T ref](v *Vector) []T

func PreAlloc

func PreAlloc(v, w *Vector, rows int, m *mheap.Mheap)

func Reset

func Reset(v *Vector)

func SetCol

func SetCol(v *Vector, col interface{})

func SetLength

func SetLength(v *Vector, n int)

func SetScalarLength added in v0.5.0

func SetScalarLength(v *Vector, n int)

func SetVectorLength added in v0.5.0

func SetVectorLength(v *Vector, n int)

func Shrink

func Shrink(v *Vector, sels []int64)

func Shuffle

func Shuffle(v *Vector, sels []int64, m *mheap.Mheap) error

func Union

func Union(v, w *Vector, sels []int64, m *mheap.Mheap) error

func UnionBatch

func UnionBatch(v, w *Vector, offset int64, cnt int, flags []uint8, m *mheap.Mheap) error

func UnionNull added in v0.5.0

func UnionNull(v, _ *Vector, m *mheap.Mheap) error

func UnionOne

func UnionOne(v, w *Vector, sel int64, m *mheap.Mheap) error

Types

type Vector

type Vector struct {
	Or   bool   // true: origin
	Ref  uint64 // reference count
	Link uint64 // link count
	Data []byte // raw data
	Typ  types.Type
	Col  interface{}  // column data, encoded Data
	Nsp  *nulls.Nulls // nulls list

	// some attributes for const vector (a vector with a lot of rows of a same const value)
	IsConst bool
	Length  int
}

* origin true: * count || type || bitmap size || bitmap || vector * origin false: * count || vector

func Dup

func Dup(v *Vector, m *mheap.Mheap) (*Vector, error)

func New

func New(typ types.Type) *Vector

func NewConst added in v0.5.0

func NewConst(typ types.Type) *Vector

func NewConstNull added in v0.5.0

func NewConstNull(typ types.Type) *Vector

func Window

func Window(v *Vector, start, end int, w *Vector) *Vector

func (*Vector) Append added in v0.5.0

func (v *Vector) Append(w any, m *mheap.Mheap) error

func (*Vector) ConstExpand added in v0.5.0

func (v *Vector) ConstExpand(m *mheap.Mheap) *Vector

func (*Vector) ConstVectorIsNull added in v0.5.0

func (v *Vector) ConstVectorIsNull() bool

ConstVectorIsNull checks whether a const vector is null

func (*Vector) FillDefaultValue added in v0.5.0

func (v *Vector) FillDefaultValue()

func (*Vector) Free added in v0.5.0

func (v *Vector) Free(m *mheap.Mheap)

func (*Vector) GetColumnData

func (v *Vector) GetColumnData(selectIndexs []int64, occurCounts []int64, rs []string) error

GetColumnData get whole column from a vector

func (*Vector) IsScalar added in v0.5.0

func (v *Vector) IsScalar() bool

IsScalar return true if the vector means a scalar value. e.g.

a + 1, and 1's vector will return true

func (*Vector) IsScalarNull added in v0.5.0

func (v *Vector) IsScalarNull() bool

IsScalarNull return true if the vector means a scalar Null. e.g.

a + Null, and the vector of right part will return true

func (*Vector) Read

func (v *Vector) Read(data []byte) error

func (*Vector) Realloc added in v0.5.0

func (v *Vector) Realloc(size int, m *mheap.Mheap) error

func (*Vector) Show

func (v *Vector) Show() ([]byte, error)

func (*Vector) String

func (v *Vector) String() string

func (*Vector) ToConst added in v0.5.0

func (v *Vector) ToConst(row int) *Vector

Jump to

Keyboard shortcuts

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