Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to hash a data field in nifi

How to hash a data field in nifi

New Contributor

Hi,

I have a QueryDatabaseTable component that extracts thousands of rows from a table. I want to hash one of those values before writing the updated avro or json to hdfs. It looks like the HashContent component hashes the whole content - whereas I only wish to hash one of the values in each row.

How can I do this?

Thanks,

Bryan

3 REPLIES 3
Highlighted

Re: How to hash a data field in nifi

Contributor

@Bryan Quinn

Did you check the HashAttribute processor ?

http://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache....

It looks like it will do what you are looking for.

Thanks,

Zohar

Highlighted

Re: How to hash a data field in nifi

New Contributor

@zhoussen

I don't think that helps. I want to be able to apply a sha-256 hash to one of my values.

Any other suggestions? Seems like a common enough use case..

Thanks,

Bryan

Highlighted

Re: How to hash a data field in nifi

Contributor

@Bryan Quinn

You are correct. I missed the fact that the processor hashes attributes together rather than apply an sha hash. My bad. It looks like no processor is available to do this today, but NIFI-2961 has been opened to address this given requirement. The suggested alternative would be to do it through ExecuteScript processor. Please check the following thread for further details: http://apache-nifi-users-list.2361937.n4.nabble.com/Encryption-and-Hashing-in-Nifi-td2307.html

Thanks,

Zohar

Don't have an account?
Coming from Hortonworks? Activate your account here