How to do MD5 hashing of as string in athena?

时间:2019-04-17 01:36:50

标签: amazon-athena presto

MD5 hashing function in athena is not working for string. However, athena's document shows that it does : https://docs.aws.amazon.com/redshift/latest/dg/r_MD5.html

Not sure what I am missing here. If I transform varchar to varbinary then the hash that gets generated are not correct.

Getting this error :


SYNTAX_ERROR: line 1:8: Unexpected parameters (varchar(15)) for function md5. Expected: md5(varbinary)

This query ran against the "temp" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id: dd959e8a-7fa4-4170-8895-ce7cf58be6ea.```

1 个答案:

答案 0 :(得分:1)

Athena / Presto中的enter image description here函数采用二进制输入。您可以使用md5函数将字符串转换为varbinary:

my-required-libs.zip