Modifying the HSMM process

The Hive Strict Managed Migration process (HSMM) runs across all databases to ensure the logic is applied to each database definition. But, you want HSMM to skip processing tables in these databases. To stop this action, you must directly modify the Ambari-DC Hive Upgrade Process.

You upgraded to Ambari-DC but have not yet performed the HDP upgrade that will be used to upgrade the platform stack from Hive 1 to Hive 3.
Perform this procedure if you want to expedite the upgrade process as described in the last topic. If you do not want to use the Hive Upgrade Check tool, you need to perform the tasks described in the following subtopics to migrate Hive data to CDP:
  • Check SERDE Definitions and Availability
  • Handle Missing Table or Partition Locations
  • Manage Table Location Mapping
  • Make Tables SparkSQL Compatible
  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.