What does the MD5 function do?

Knowledge Drop

Last tested: March 2021

MD5 is just a hash that turns strings into hashes.

It’s useful for making IDs out of a concatenation of several fields, which makes it valuable for joins. Looker uses it in symmetric aggregates.

Example:

select md5('Amazon Redshift'); md5  ----------------------------------  f7415e33f972c03abd4f3fed36748f7a  (1 row)

Great blog explaining it.

In addition to the linked community article on symmetric aggregates, there is an explanation of why symmetric aggregates look complicated here: https://cloud.google.com/looker/docs/best-practices/understanding-symmetric-aggregates#3