Tuesday, 30 May 2017

Comparing if two tables have identical content

Have you ever wanted to know if two database tables were the same? Perhaps you made some changes to a query and wanted to know if the result was still the same.

I was essentially looking for a way to diff two tables in Hive SQL, and used:
(TABLE a EXCEPT TABLE b)
UNION ALL
(TABLE b EXCEPT TABLE a);