Documentation ¶
Index ¶
- Constants
- Variables
- type HashMap
- type IntHashMap
- type Iterator
- type JoinMap
- type StrHashMap
- func (m *StrHashMap) AddGroup()
- func (m *StrHashMap) AddGroups(rows uint64)
- func (m *StrHashMap) Cardinality() uint64
- 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
Constants ¶
View Source
const (
UnitLimit = 256
)
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 }
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) 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
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 [][]int64, expr *plan.Expr, mp *StrHashMap, hasNull bool, idx *index.LowCardinalityIndex) *JoinMap
func (*JoinMap) Index ¶ added in v0.6.0
func (jm *JoinMap) Index() *index.LowCardinalityIndex
func (*JoinMap) Map ¶ added in v0.6.0
func (jm *JoinMap) Map() *StrHashMap
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) 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
Click to show internal directories.
Click to hide internal directories.