Missing Hive tables

In case you have lost the Hive tables, you can recover them by performing a few steps.

  1. Login as Superuser HDFS. For example:
    $ sudo su - hdfs
  2. On HDFS, read the snapshots you saved of your table data. For example:
     $ hdfs dfs -cat /apps/hive/warehouse/.snapshot/s20181204-164645.898/students/000000_0
    

    Example output for a trivial table having two rows and three columns might look something like this:

     fred flintstone351.28
     barney rubble322.32
  3. In Hive, insert the data into the table if the schema exists in the Hive warehouse; otherwise, restore the Hive Metastore, which includes the schemas, from the database dump you created in the pre-upgrade process.