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

Add ability to calculate hashes from values of UUID type #5184

Closed
ghost opened this issue May 3, 2019 · 1 comment
Closed

Add ability to calculate hashes from values of UUID type #5184

ghost opened this issue May 3, 2019 · 1 comment
Assignees
Labels
easy task Good for first contributors feature st-accepted The issue is in our backlog, ready to take

Comments

@ghost
Copy link

ghost commented May 3, 2019

It would be nice to have an ability to quickly calculate hash function from values of UUID type without prior conversion to string.

Right now it is possible to do cityHash64(toString(uuidValue)), but it is inefficient because of the need to make conversions to strings.

Use case
To make use of UUIDs in sampling expressions or sharding keys more efficient.

Describe the solution you'd like
I would like to have ability to calculate cityHash64 or intHash64 from values that have UUID type.

Describe alternatives you've considered
An alternative would be to make it possible to use values of UUID type as sampling expressions and sharding keys as is, without the need to produce integer hashes from them.

@ghost ghost added the feature label May 3, 2019
@alexey-milovidov alexey-milovidov added easy task Good for first contributors st-accepted The issue is in our backlog, ready to take labels Nov 1, 2019
@alexey-milovidov
Copy link
Member

This is also relevant for Decimal:

SELECT cityHash64(generateUUIDv4())
SELECT cityHash64(toDecimal128(0, 10))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy task Good for first contributors feature st-accepted The issue is in our backlog, ready to take
Projects
None yet
Development

No branches or pull requests

2 participants