Documentation
¶
Index ¶
- Variables
- func BatchToProtoBatch(bat *Batch) (*api.Batch, error)
- func SetLength(bat *Batch, n int)
- type Batch
- func EmptyBatchWithAttrs(attrs []string) Batch
- func New(attrs []string) *Batch
- func NewOffHeap(attrs []string) *Batch
- func NewOffHeapEmpty() *Batch
- func NewOffHeapWithSize(n int) *Batch
- func NewWithSchema(offHeap bool, attrs []string, attTypes []types.Type) *Batch
- func NewWithSize(n int) *Batch
- func ProtoBatchToBatch(bat *api.Batch) (*Batch, error)
- func (bat *Batch) AddRowCount(rowCount int)
- func (bat *Batch) Allocated() int
- func (bat *Batch) Append(ctx context.Context, mp *mpool.MPool, b *Batch) (*Batch, error)
- func (bat *Batch) AppendWithCopy(ctx context.Context, mp *mpool.MPool, b *Batch) (*Batch, error)
- func (bat *Batch) CheckLength() error
- func (bat *Batch) Clean(m *mpool.MPool)
- func (bat *Batch) CleanOnlyData()
- func (bat *Batch) Clone(mp *mpool.MPool, offHeap bool) (*Batch, error)
- func (bat *Batch) CloneSelectedColumns(selectCols []int, selectAttrs []string, mp *mpool.MPool) (cloned *Batch, err error)
- func (bat *Batch) CloneSelectedColumnsTo(selectCols []int, toBat *Batch, mp *mpool.MPool) (err error)
- func (bat *Batch) CloneTo(toBat *Batch, mp *mpool.MPool) (err error)
- func (bat *Batch) Dup(mp *mpool.MPool) (*Batch, error)
- func (bat *Batch) End() bool
- func (bat *Batch) FreeColumns(m *mpool.MPool)
- func (bat *Batch) GetSchema() (attrs []string, attrTypes []types.Type)
- func (bat *Batch) GetVector(pos int32) *vector.Vector
- func (bat *Batch) InsertVector(pos int32, attr string, vec *vector.Vector)
- func (bat *Batch) IsDone() bool
- func (bat *Batch) IsEmpty() bool
- func (bat *Batch) Last() bool
- func (bat *Batch) MarshalBinary() ([]byte, error)
- func (bat *Batch) MarshalBinaryWithBuffer(w *bytes.Buffer, reset bool) ([]byte, error)
- func (bat *Batch) PreExtend(mp *mpool.MPool, rows int) error
- func (bat *Batch) ReplaceVector(oldVec *vector.Vector, newVec *vector.Vector, startIndex int)
- func (bat *Batch) RowCount() int
- func (bat *Batch) SelectColumns(cols []int, attrs []string) *Batch
- func (bat *Batch) SetAttributes(attrs []string)
- func (bat *Batch) SetEnd()
- func (bat *Batch) SetLast()
- func (bat *Batch) SetRowCount(rowCount int)
- func (bat *Batch) SetVector(pos int32, vec *vector.Vector)
- func (bat *Batch) Shrink(sels []int64, negate bool)
- func (bat *Batch) ShrinkByMask(sels *bitmap.Bitmap, negate bool, offset uint64)
- func (bat *Batch) Shuffle(sels []int64, m *mpool.MPool) error
- func (bat *Batch) Size() int
- func (bat *Batch) String() string
- func (bat *Batch) Union(bat2 *Batch, sels []int64, m *mpool.MPool) error
- func (bat *Batch) UnionOne(bat2 *Batch, pos int64, m *mpool.MPool) error
- func (bat *Batch) UnionWindow(bat2 *Batch, offset, cnt int, m *mpool.MPool) error
- func (bat *Batch) UnmarshalBinary(data []byte) (err error)
- func (bat *Batch) UnmarshalBinaryWithAnyMp(data []byte, mp *mpool.MPool) (err error)
- func (bat *Batch) UnmarshalFromReader(r io.Reader, mp *mpool.MPool) (err error)
- func (bat *Batch) VectorCount() int
- func (bat *Batch) Window(start, end int) (*Batch, error)
- type BatchSet
- func (bs *BatchSet) Clean(mpool *mpool.MPool)
- func (bs *BatchSet) Extend(mpool *mpool.MPool, inBatch *Batch, reuseBuf *Batch) (bool, error)
- func (bs *BatchSet) Get(idx int) *Batch
- func (bs *BatchSet) Length() int
- func (bs *BatchSet) Pop() *Batch
- func (bs *BatchSet) PopFront() *Batch
- func (bs *BatchSet) Push(mpool *mpool.MPool, inBatch *Batch) error
- func (bs *BatchSet) RowCount() int
- func (bs *BatchSet) TakeBatches() []*Batch
- func (bs *BatchSet) Union(mpool *mpool.MPool, inBatch *Batch, sels []int32, reuseBuf *Batch) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var ( EmptyBatch = &Batch{rowCount: 0} EmptyForConstFoldBatch = &Batch{ Vecs: make([]*vector.Vector, 0), rowCount: 1, } CteEndBatch = &Batch{ Recursive: 2, rowCount: 1, } )
special batch that will never been free.
Functions ¶
Types ¶
type Batch ¶
type Batch struct {
// For recursive CTE, 1 is last batch, 2 is end of batch
Recursive int32
ShuffleIDX int32 //used only in shuffle
// Attrs column name list, letter case: origin
Attrs []string
// Vecs col data
Vecs []*vector.Vector
ExtraBuf []byte
// contains filtered or unexported fields
}
Batch represents a part of a relationship, it's the basic unit for data transmission in the computing layer of MatrixOne.
this includes information such as column names (Attrs), column data (Vecs), the number of rows (rowCount), aggregation intermediate data (Aggs), and some specific flags like Recursive, ShuffleIDX.
offHeap is true means this batch was allocated outside mpool.
func EmptyBatchWithAttrs ¶
func NewOffHeap ¶
func NewOffHeapEmpty ¶
func NewOffHeapEmpty() *Batch
func NewOffHeapWithSize ¶
func NewWithSize ¶ added in v0.5.0
func (*Batch) AddRowCount ¶ added in v1.0.0
func (*Batch) AppendWithCopy ¶ added in v1.2.0
AppendWithCopy is used to append data from batch `b` to another batch `bat`. The function ensures that the batch structure is consistent and copies all vector data to the target batch. WARING: this function will cause a memory allocation.
func (*Batch) CheckLength ¶
func (*Batch) CleanOnlyData ¶ added in v0.8.0
func (bat *Batch) CleanOnlyData()
func (*Batch) CloneSelectedColumns ¶
func (*Batch) CloneSelectedColumnsTo ¶
func (*Batch) Dup ¶ added in v0.8.0
Dup used to copy a Batch object, this method will create a new batch and copy all vectors (Vecs) of the current batch to the new batch.
func (*Batch) FreeColumns ¶
func (*Batch) InsertVector ¶
func (*Batch) MarshalBinary ¶ added in v0.6.0
func (*Batch) MarshalBinaryWithBuffer ¶
func (*Batch) ReplaceVector ¶ added in v0.8.0
func (*Batch) SetAttributes ¶ added in v0.6.0
func (*Batch) SetRowCount ¶ added in v1.0.0
func (*Batch) ShrinkByMask ¶
func (*Batch) UnionWindow ¶
func (*Batch) UnmarshalBinary ¶ added in v0.6.0
func (*Batch) UnmarshalBinaryWithAnyMp ¶
func (*Batch) UnmarshalFromReader ¶
func (*Batch) VectorCount ¶ added in v0.6.0
type BatchSet ¶
type BatchSet struct {
// contains filtered or unexported fields
}
simple batch slice if BatchSet.batches[lastIdx].rowCount < batchMaxRow just fill data to BatchSet.batches[lastIdx] until BatchSet.batches[lastIdx].rowCount to batchMaxRow
func NewBatchSet ¶
func (*BatchSet) Extend ¶
Extend extend one batch'data to BatchSet, returns whether reuseBuf was consumed BatchSet donot obtain ownership of inBatch