batch

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

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

View Source
var (
	EmptyBatch             = &Batch{}
	EmptyForConstFoldBatch = NewWithSize(0)
)

Functions

func BatchToProtoBatch added in v0.6.0

func BatchToProtoBatch(bat *Batch) (*api.Batch, error)

func Cow

func Cow(bat *Batch)

func Length

func Length(bat *Batch) int

func Reorder

func Reorder(bat *Batch, attrs []string)

func SetLength

func SetLength(bat *Batch, n int)

Types

type Batch

type Batch struct {
	// Ro if true, Attrs is read only
	Ro bool
	// reference count, default is 1
	Cnt int64
	// Attrs column name list
	Attrs []string
	// Vecs col data
	Vecs []*vector.Vector
	// ring
	Zs   []int64
	Aggs []agg.Agg[any]

	AuxData any // hash table, runtime filter, etc.
}

Batch represents a part of a relationship including an optional list of row numbers, columns and list of attributes

(SelsData, Sels) - list of row numbers
(Attrs) - list of attributes
(vecs) 	- columns

func New

func New(ro bool, attrs []string) *Batch

func NewWithSize added in v0.5.0

func NewWithSize(n int) *Batch

func ProtoBatchToBatch added in v0.6.0

func ProtoBatchToBatch(bat *api.Batch) (*Batch, error)

func (*Batch) AddCnt added in v0.8.0

func (bat *Batch) AddCnt(cnt int)

func (*Batch) AntiShrink added in v0.8.0

func (bat *Batch) AntiShrink(sels []int64)

func (*Batch) Append

func (bat *Batch) Append(ctx context.Context, mh *mpool.MPool, b *Batch) (*Batch, error)

func (*Batch) Clean added in v0.5.0

func (bat *Batch) Clean(m *mpool.MPool)

func (*Batch) CleanOnlyData added in v0.8.0

func (bat *Batch) CleanOnlyData()

func (*Batch) Dup added in v0.8.0

func (bat *Batch) Dup(mp *mpool.MPool) (*Batch, error)

func (*Batch) GetCnt added in v0.8.0

func (bat *Batch) GetCnt() int64

func (*Batch) GetSubBatch added in v0.6.0

func (bat *Batch) GetSubBatch(cols []string) *Batch

func (*Batch) GetVector added in v0.5.0

func (bat *Batch) GetVector(pos int32) *vector.Vector

func (*Batch) InitZsOne

func (bat *Batch) InitZsOne(len int)

InitZsOne init Batch.Zs and values are all 1

func (*Batch) Length added in v0.5.0

func (bat *Batch) Length() int

func (*Batch) MarshalBinary added in v0.6.0

func (bat *Batch) MarshalBinary() ([]byte, error)

func (*Batch) Prefetch added in v0.5.0

func (bat *Batch) Prefetch(poses []int32, vecs []*vector.Vector)

func (*Batch) ReplaceVector added in v0.8.0

func (bat *Batch) ReplaceVector(oldVec *vector.Vector, newVec *vector.Vector)

func (*Batch) SetAttributes added in v0.6.0

func (bat *Batch) SetAttributes(attrs []string)

func (*Batch) SetCnt added in v0.8.0

func (bat *Batch) SetCnt(cnt int64)

func (*Batch) SetVector added in v0.6.0

func (bat *Batch) SetVector(pos int32, vec *vector.Vector)

func (*Batch) SetZs added in v0.6.0

func (bat *Batch) SetZs(len int, m *mpool.MPool)

XXX I will slowly remove all code that uses InitZsone.

func (*Batch) Shrink added in v0.5.0

func (bat *Batch) Shrink(sels []int64)

I think Shrink should have a mpool!!!

func (*Batch) Shuffle added in v0.5.0

func (bat *Batch) Shuffle(sels []int64, m *mpool.MPool) error

func (*Batch) Size added in v0.6.0

func (bat *Batch) Size() int

func (*Batch) String

func (bat *Batch) String() string

func (*Batch) SubCnt added in v0.8.0

func (bat *Batch) SubCnt(cnt int)

func (*Batch) UnmarshalBinary added in v0.6.0

func (bat *Batch) UnmarshalBinary(data []byte) error

func (*Batch) VectorCount added in v0.6.0

func (bat *Batch) VectorCount() int

type EncodeBatch added in v0.6.0

type EncodeBatch struct {
	Zs       []int64
	Vecs     []*vector.Vector
	Attrs    []string
	AggInfos []aggInfo
}

func (*EncodeBatch) MarshalBinary added in v0.8.0

func (m *EncodeBatch) MarshalBinary() ([]byte, error)

func (*EncodeBatch) UnmarshalBinary added in v0.8.0

func (m *EncodeBatch) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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