featurebase/extendiblehash/key.go
pokeeffe-molecula 74ee3ebf0e implemented DISTINCT (fb-1562) (#2388)
* implemented distinct

* implemented distinct
* uses first cut of a buffer pool, and extendible hashing with thresholded spill to disk
* tests
* cleaned up some stuff around query plan output to make developing tooling easier
* added optimization to call PQL Distinct()

* fixed test

* fix for passing wrong index name in orchestrator

* back out change to DistinctTimestamp

* fix other instance of wrong table name being passed

* use full index name instead of abbreviated one for translation. sigh.

* removed some unused code

Co-authored-by: Matthew Jaffee <jaffee@pilosa.com>
(cherry picked from commit f030d58d95)
2023-01-10 23:28:00 +00:00

24 lines
382 B
Go

package extendiblehash
import (
"github.com/zeebo/xxh3"
)
type Hashable interface {
Hash() uint64
}
// use the same seed all the time - this is not for crypto
var protoSeed uint64 = 20041973
var hasher = xxh3.NewSeed(protoSeed)
type Key []byte
// BEWARE - not concurrent!!
func (k Key) Hash() uint64 {
hasher.Reset()
hasher.Write(k)
hash := hasher.Sum64()
return hash
}