HASH_MD5 not working with non-char datasets

Database

HASH_MD5 not working with non-char datasets

Hello all, Problem Statement : I'm on Teradata 13.10, i'm trying to use hash_md5() on my table records to check content integrity with the same records offloaded as files in HDFS. Whenever i'm trying to apply the function on some column which are non-character in nature, the function returns 5589 error saying "hash_md5 does not exist". Question: is this normal behavior with this version of teradata and the UDF package i've downloaded from this link below? is there a workaround for this , since i will not be casting non-char columns to char just to validate where the target system will not the permit similar casting? UDF Package Link: https://downloads.teradata.com/download/extensibility/md5-message-digest-udf
2 REPLIES
Junior Contributor

Re: HASH_MD5 not working with non-char datasets

MD5 is a defined to work on strings only, without CAST there's no way to run it against numeric data. 

Re: HASH_MD5 not working with non-char datasets

Thanks for the confirmation doneth, but I also came across some posts regarding hash_md5() where people are using it to generate a hash value against "all columns" of a table. For example hash_md5(column1||column2||column3.....||column n) returns a checksum value. Now is it because Teradata internally considers the entire concatenated set as a string and there can be any datatype in those columns? OR it is well assumed that all of those columns are actually strings in nature?