Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

MD5 value of a table

avatar
Visitor

How can we get 1 MD5 value for a hive table? Do not need a MD5 value for each record in the table.  Is there a way to query the MD5() at a table level. Thanks

2 REPLIES 2

avatar
Expert Contributor

avatar
Master Collaborator

@Kiddo you either need to get the md5 of all the records or  you could collect it for the concatenated form of all the column names in a table.

 

e.g.

select md5(concat(col1,col2)) from table1;

 

or.

select md5(concat(*)) from (SELECT collect_list(column_name) as col_name from information_schema.columns where table_schema='db1' and
table_name='table1')e;

 

Hope this answers your question.