Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement approx_distinct using HyperLogLog #1083

Closed
jimexist opened this issue Oct 8, 2021 · 4 comments · Fixed by #1087
Closed

Implement approx_distinct using HyperLogLog #1083

jimexist opened this issue Oct 8, 2021 · 4 comments · Fixed by #1087
Labels
enhancement New feature or request

Comments

@jimexist
Copy link
Member

jimexist commented Oct 8, 2021

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and why for this feature, in addition to the what)

Implement HyperLogLog functions

Describe the solution you'd like
A clear and concise description of what you want to happen.

Similar to that of presto/trino

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@jimexist jimexist added the enhancement New feature or request label Oct 8, 2021
@jimexist
Copy link
Member Author

jimexist commented Oct 8, 2021

@houqp @alamb is this of any use to your usecases?

@houqp
Copy link
Member

houqp commented Oct 8, 2021

It looks like a fun engineering challenge and a really cool feature to add :D I don't have a use-case for this at the moment but I think it's something we would need to support eventually in ballista to close the gap with spark.

@jimexist
Copy link
Member Author

jimexist commented Oct 8, 2021

relevant links:

  1. smhasher test suite
  2. trino uses xxhash 64 bit version
  3. hyperloglog.c from redis, which uses murmur3 64 bit version
  4. xxhash v.s. murmur3, as of 2016 seems like xxhash has better throughput for larger data size
  5. https://github.com/shepmaster/twox-hash
  6. https://docs.rs/pdatastructs/0.6.0/pdatastructs/hyperloglog/struct.HyperLogLog.html and https://docs.rs/hyperloglogplus/0.4.0/hyperloglogplus/struct.HyperLogLogPlus.html

@alamb
Copy link
Contributor

alamb commented Oct 8, 2021

@houqp @alamb is this of any use to your usecases?

Yes, I think it is relevant @jimexist and I think it is a great idea. Will try and review #1087 shortly.

Another thing that would be awesome (as a follow on PR) would be to support approx_distinct using Statistics, even when those statistics weren't super accurate (e.g in IOx we have deferred deletes and upserts that are not resolved until actual read time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants