batch

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyBatch = &Batch{rowCount: 0}

	EmptyForConstFoldBatch = &Batch{
		Cnt:      1,
		Vecs:     make([]*vector.Vector, 0),
		rowCount: 1,
	}
)

Functions

func BatchToProtoBatch added in v0.6.0

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

func SetLength

func SetLength(bat *Batch, n int)

Types

type Batch

type Batch struct {
	// For recursive CTE, 1 is last batch, 2 is end of batch
	Recursive int32
	// Ro if true, Attrs is read only
	Ro         bool
	ShuffleIDX int //used only in shuffle dispatch
	// reference count, default is 1
	Cnt int64
	// Attrs column name list
	Attrs []string
	// Vecs col data
	Vecs []*vector.Vector

	Aggs []aggexec.AggFuncExec

	AuxData any // hash table etc.
	// contains filtered or unexported fields
}

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) AddRowCount added in v1.0.0

func (bat *Batch) AddRowCount(rowCount int)

func (*Batch) Append

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

func (*Batch) AppendWithCopy added in v1.2.0

func (bat *Batch) AppendWithCopy(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) DupJmAuxData added in v1.0.0

func (bat *Batch) DupJmAuxData() (ret *hashmap.JoinMap)

func (*Batch) End added in v1.0.0

func (bat *Batch) End() bool

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) IsEmpty added in v1.0.0

func (bat *Batch) IsEmpty() bool

func (*Batch) Last added in v1.0.0

func (bat *Batch) Last() bool

func (*Batch) Log added in v1.0.0

func (bat *Batch) Log(tag string)

func (*Batch) MarshalBinary added in v0.6.0

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

func (*Batch) PreExtend added in v1.0.0

func (bat *Batch) PreExtend(m *mpool.MPool, rows int) 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) RowCount added in v1.0.0

func (bat *Batch) RowCount() int

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) SetEnd added in v1.0.0

func (bat *Batch) SetEnd()

func (*Batch) SetLast added in v1.0.0

func (bat *Batch) SetLast()

func (*Batch) SetRowCount added in v1.0.0

func (bat *Batch) SetRowCount(rowCount int)

func (*Batch) SetVector added in v0.6.0

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

func (*Batch) Shrink added in v0.5.0

func (bat *Batch) Shrink(sels []int64, negate bool)

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) UnmarshalBinary added in v0.6.0

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

func (*Batch) UnmarshalBinaryWithCopy added in v1.2.0

func (bat *Batch) UnmarshalBinaryWithCopy(data []byte, mp *mpool.MPool) error

func (*Batch) VectorCount added in v0.6.0

func (bat *Batch) VectorCount() int

type EncodeBatch added in v0.6.0

type EncodeBatch struct {
	Vecs      []*vector.Vector
	Attrs     []string
	AggInfos  [][]byte
	Recursive int32
	// contains filtered or unexported fields
}

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

func (*EncodeBatch) UnmarshalBinaryWithCopy added in v1.2.0

func (m *EncodeBatch) UnmarshalBinaryWithCopy(data []byte, mp *mpool.MPool) error

Jump to

Keyboard shortcuts

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