I have a table in Snowflake generated like:
create or replace temporary table example (asset_id int, assignment_id int);
insert into example (asset_id, assignment_id)
values
(5000, 1),
(5000, 1),
(5000, 1),
(6000, 1),
(6000, 2);
select
asset_id,
assignment_id,
uuid_string(uuid_string(), md5(concat(asset_id, assignment_id))) as uuid_assignment
from
example;
I'd like to generate a uuid_string()
for the combination of both asset_id
and assignment_id
using an md5 hash. After reading the documentation on uuid_string()
I am a little confused on how to do what I am asking. I know uuid_string() is generating a random uuid, but I want to be able to assign the random generated uuid to a deterministic md5 hash.
https://docs.snowflake.com/en/sql-reference/functions/uuid_string