Search code examples
hadoophiveapache-pighcatalog

File loaded in hive using Pig/hive mismatch


If a file is loaded into hive tables, one by using Pig and one by using hive. How do you make sure that data in both table is same? How do you get the mismatched records from both tables?


Solution

  • They should be same, if you want to be sure, run these hive queries:

    SELECT * from table_pig
    WHERE NOT EXISTS (select * from table_hive)
    

    and

    SELECT * from table_hive
    WHERE NOT EXISTS (select * from table_pig)
    

    If the two queries didnt return any record, then both tables are same.