segmentio / go-hll Goto Github PK
View Code? Open in Web Editor NEWGo implementation of HLL that plays nicely with other languages
License: MIT License
Go implementation of HLL that plays nicely with other languages
License: MIT License
I'm using v1.0.1 and run into a out-of-range-access when union two hlls. The statement give rise to this problem is "s.Union(l)", where the s
is using dense storage and have setting with log2m:11 and regwidth:8, and the l
is using sparse storage with settings log2m:13 and regwidth:5.
When s bit-masking the bit corresponding to the element from l
, it does not scale its current storage, and hence incur out-of-range access.
go-hll.denseStorage.setIfGreater at dense.go:175
go-hll.(*Hll).union at hll.go:331
go-hll.(*Hll).Union at hll.go:246
I don't get chance to produce minimal testing case to produce the this problem. I'm wondering if above description is sufficient.
I'm trying to give a workaround as following, is it safe?
s_settings, l_settings = get both s and l's settings
calculate sz(hll) = (1<< hll.log2m) * hll.regwidth
if sz(s) < sz(l) {
l.union(s)
} else {
s.union(l)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.