How to hash a string to a bigint in presto?

by raphael_tillman , in category: Third Party Scripts , 4 months ago

How to hash a string to a bigint in presto?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by lily , 4 months ago

@raphael_tillman 

In Presto, you can use the hash function to hash a string into a bigint value. Here's an example of how you can do this:

1
SELECT hash('your_string_here') AS hashed_value;


This will return a bigint value representing the hash of the input string. You can use this hashed value in your queries for various purposes such as partitioning or grouping data.

Related Threads:

How to run md5() on a bigint in presto?
How to properly compare bigint column in mysql 5.7?
How to cast date as date string in presto?
How to parse month-year string using presto?
How to count occurrences of a character in a string in presto?
How to decrypt hash password in laravel?