vector

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 12 Imported by: 1

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 GetColumn added in v0.5.1

func GetColumn[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, length int) *Vector

func NewConstNull added in v0.5.0

func NewConstNull(typ types.Type, length int) *Vector

func NewWithData added in v0.5.1

func NewWithData(typ types.Type, data []byte, col interface{}, nsp *nulls.Nulls) *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) Count added in v0.5.1

func (v *Vector) Count() int

return the number of rows in the vector

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) GetNulls added in v0.5.1

func (v *Vector) GetNulls() *nulls.Nulls

func (*Vector) GetString added in v0.5.1

func (v *Vector) GetString(i int64) []byte

func (*Vector) GetType added in v0.5.1

func (v *Vector) GetType() types.Type

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

func (*Vector) TryExpandNulls added in v0.5.1

func (v *Vector) TryExpandNulls(n int)

Jump to

Keyboard shortcuts

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