Documentation ¶
Index ¶
- Constants
- Variables
- type HashMap
- type IntHashMap
- func (m *IntHashMap) AddGroup()
- func (m *IntHashMap) AddGroups(rows uint64)
- func (m *IntHashMap) Cardinality() uint64
- func (m *IntHashMap) Dup(pool *mpool.MPool) *IntHashMap
- func (m *IntHashMap) Free()
- func (m *IntHashMap) GroupCount() uint64
- func (m *IntHashMap) HasNull() bool
- func (m *IntHashMap) NewIterator() *intHashMapIterator
- func (m *IntHashMap) PreAlloc(n uint64, mp *mpool.MPool) error
- func (m *IntHashMap) Size() int64
- type Iterator
- type JoinMap
- func (jm *JoinMap) Dup() *JoinMap
- func (jm *JoinMap) Expr() *plan.Expr
- func (jm *JoinMap) Free()
- func (jm *JoinMap) HasNull() bool
- func (jm *JoinMap) IncRef(ref int64)
- func (jm *JoinMap) IsDup() bool
- func (jm *JoinMap) NewIterator() Iterator
- func (jm *JoinMap) PushedRuntimeFilterIn() bool
- func (jm *JoinMap) Sels() [][]int32
- func (jm *JoinMap) SetDupCount(ref int64)
- func (jm *JoinMap) SetPushedRuntimeFilterIn(b bool)
- func (jm *JoinMap) Size() int64
- type StrHashMap
- func (m *StrHashMap) AddGroup()
- func (m *StrHashMap) AddGroups(rows uint64)
- func (m *StrHashMap) Cardinality() uint64
- func (m *StrHashMap) Dup(pool *mpool.MPool) *StrHashMap
- func (m *StrHashMap) Free()
- func (m *StrHashMap) GroupCount() uint64
- func (m *StrHashMap) HasNull() bool
- func (m *StrHashMap) Insert(vecs []*vector.Vector, row int) (bool, error)
- func (m *StrHashMap) InsertValue(val any) (bool, error)
- func (m *StrHashMap) NewIterator() Iterator
- func (m *StrHashMap) PreAlloc(n uint64, mp *mpool.MPool) error
- func (m *StrHashMap) Size() int64
Constants ¶
View Source
const ( UnitLimit = 256 HashMapSizeThreshHold = UnitLimit * 128 HashMapSizeEstimate = UnitLimit * 32 )
Variables ¶
View Source
var ( OneUInt8s []uint8 OneInt64s []int64 )
Functions ¶
This section is empty.
Types ¶
type HashMap ¶ added in v0.6.0
type HashMap interface { // HasNull returns whether the hash map considers the null values. HasNull() bool // Free method frees the hash map. Free() // AddGroup adds 1 to the row count of hash map. AddGroup() // AddGroups adds N to the row count of hash map. AddGroups(uint64) // GroupCount returns the hash map's row count. GroupCount() uint64 // Size returns the hash map's size Size() int64 }
HashMap is the encapsulated hash table interface exposed to the outside
type IntHashMap ¶ added in v0.6.0
type IntHashMap struct {
// contains filtered or unexported fields
}
IntHashMap key is int64, value is an uint64 (start from 1) before you use the IntHashMap, the user should make sure that sum of vectors' length equal to 8
func NewIntHashMap ¶ added in v0.6.0
func (*IntHashMap) AddGroup ¶ added in v0.6.0
func (m *IntHashMap) AddGroup()
func (*IntHashMap) AddGroups ¶ added in v0.6.0
func (m *IntHashMap) AddGroups(rows uint64)
func (*IntHashMap) Cardinality ¶ added in v0.6.0
func (m *IntHashMap) Cardinality() uint64
func (*IntHashMap) Dup ¶ added in v1.1.0
func (m *IntHashMap) Dup(pool *mpool.MPool) *IntHashMap
func (*IntHashMap) Free ¶ added in v0.6.0
func (m *IntHashMap) Free()
func (*IntHashMap) GroupCount ¶ added in v0.6.0
func (m *IntHashMap) GroupCount() uint64
func (*IntHashMap) HasNull ¶ added in v0.6.0
func (m *IntHashMap) HasNull() bool
func (*IntHashMap) NewIterator ¶ added in v0.6.0
func (m *IntHashMap) NewIterator() *intHashMapIterator
func (*IntHashMap) PreAlloc ¶ added in v1.0.0
func (m *IntHashMap) PreAlloc(n uint64, mp *mpool.MPool) error
func (*IntHashMap) Size ¶ added in v0.7.0
func (m *IntHashMap) Size() int64
type Iterator ¶ added in v0.6.0
type Iterator interface { // Insert vecs[start, start+count) into hashmap // vs : the number of rows corresponding to each value in the hash table (start with 1) // zvs : if zvs[i] is 0 indicates the presence null, 1 indicates the absence of a null. Insert(start, count int, vecs []*vector.Vector) (vs []uint64, zvs []int64, err error) // Find vecs[start, start+count) in hashmap // vs : the number of rows corresponding to each value in the hash table (start with 1, and 0 means not found.) // zvs : if zvs[i] is 0 indicates the presence null, 1 indicates the absence of a null. Find(start, count int, vecs []*vector.Vector, inBuckets []uint8) (vs []uint64, zvs []int64) }
Iterator allows users to do insert or find operations on hash tables in bulk.
type JoinMap ¶ added in v0.6.0
type JoinMap struct {
// contains filtered or unexported fields
}
JoinMap is used for join
func NewJoinMap ¶ added in v0.6.0
func NewJoinMap(sels [][]int32, expr *plan.Expr, ihm *IntHashMap, shm *StrHashMap, hasNull bool, isDup bool) *JoinMap
func (*JoinMap) NewIterator ¶ added in v1.0.0
func (*JoinMap) PushedRuntimeFilterIn ¶ added in v1.2.0
func (*JoinMap) SetDupCount ¶ added in v0.7.0
func (*JoinMap) SetPushedRuntimeFilterIn ¶ added in v1.2.0
type StrHashMap ¶
type StrHashMap struct {
// contains filtered or unexported fields
}
StrHashMap key is []byte, value is an uint64 value (starting from 1)
each time a new key is inserted, the hashtable returns a last-value+1 or, if the old key is inserted, the value corresponding to that key
func (*StrHashMap) AddGroup ¶ added in v0.6.0
func (m *StrHashMap) AddGroup()
func (*StrHashMap) AddGroups ¶ added in v0.6.0
func (m *StrHashMap) AddGroups(rows uint64)
func (*StrHashMap) Cardinality ¶ added in v0.6.0
func (m *StrHashMap) Cardinality() uint64
func (*StrHashMap) Dup ¶ added in v1.1.0
func (m *StrHashMap) Dup(pool *mpool.MPool) *StrHashMap
func (*StrHashMap) Free ¶ added in v0.6.0
func (m *StrHashMap) Free()
func (*StrHashMap) GroupCount ¶ added in v0.6.0
func (m *StrHashMap) GroupCount() uint64
func (*StrHashMap) HasNull ¶ added in v0.6.0
func (m *StrHashMap) HasNull() bool
func (*StrHashMap) Insert ¶
Insert a row from multiple columns into the hashmap, return true if it is new, otherwise false
func (*StrHashMap) InsertValue ¶
func (m *StrHashMap) InsertValue(val any) (bool, error)
InsertValue insert a value, return true if it is new, otherwise false never handle null
func (*StrHashMap) NewIterator ¶ added in v0.6.0
func (m *StrHashMap) NewIterator() Iterator
func (*StrHashMap) PreAlloc ¶ added in v1.0.0
func (m *StrHashMap) PreAlloc(n uint64, mp *mpool.MPool) error
func (*StrHashMap) Size ¶ added in v0.7.0
func (m *StrHashMap) Size() int64
Click to show internal directories.
Click to hide internal directories.