Modifying the HSMM to prevent migration

By default, the Hive Strict Managed Migration process (HSMM) runs across all tables and databases. But, you want to prevent HSMM from migrating tables and databases. To change the default, you must directly modify the Ambari-DC Hive Upgrade Process.

You upgraded to Ambari-DC, but have not yet performed the HDP upgrade of the platform stack from Hive 1 to Hive 3.
Perform this procedure if you want to expedite the upgrade process.
  1. Open the following script on the Ambari Server host for editing: /var/lib/ambari-server/resources/stacks/HDP/3.0/services/HIVE/package/scripts/post_upgrade.py
  2. Make the changes as shown in the following example:

    FROM

    cmd = format("{hive_script} --config /etc/hive/conf --service  strictmanagedmigration --hiveconf hive.strict.managed.tables=true  -m automatic
    --modifyManagedTables --oldWarehouseRoot /apps/hive/warehouse")

    TO

    cmd = format("{hive_script} --config /etc/hive/conf --service  strictmanagedmigration --hiveconf hive.strict.managed.tables=true  -m automatic
    --modifyManagedTables --oldWarehouseRoot /apps/hive/warehouse --tableRegex zzzzz") 
  3. Restart the Ambari Server and agents after this change but before starting the upgrade process.