Changes to CDH Hive Tables

As a Data Scientist, Architect, Analyst, or other Hive user you need to locate and use your Apache Hive 3 tables after an upgrade. You also need to understand the changes that occur during the upgrade process. The location of existing tables after a CDH to CDP upgrade does not change. Upgrading CDH to CDP Private Cloud Base converts Hive managed tables to external tables in Hive 3.

When the upgrade process converts a managed table to external, it sets the table property external.table.purge to true. The table is equivalent to a managed table having purge set to true in your old CDH cluster.

Managed tables on the HDFS in /user/hive/warehouse before the upgrade remain there after the conversion to external. Tables that were external before the upgrade are not relocated. You need to set HDFS policies to access external tables in Ranger, or set up HDFS ACLs.

The upgrade process sets the hive.metastore.warehouse.dir property to /warehouse/tablespace/managed/hive, designating it the Hive warehouse location for managed tables. New managed tables that you create in CDP are stored in the Hive warehouse. New external tables are stored in the Hive external warehouse /warehouse/tablespace/external/hive.

To change the location of the Hive warehouses, you navigate to one of the following menu items in the first step below.
  • Hive > Action Menu > Create Hive Warehouse Directory
  • Hive > Action Menu > Create Hive Warehouse External Directory
  1. Set up directories for the Hive warehouse directory and Hive warehouse external directory from Cloudera Manager Actions.
  2. In Cloudera Manager, click Clusters > Hive (the Hive Metastore service) > Configuration, and change the hive.metastore.warehouse.dir property value to the path you specified for the new Hive warehouse directory.
  3. Change the hive.metastore.warehouse.external.dir property value to the path you specified for the Hive warehouse external directory.
  4. Configure Ranger policies or set up ACL permissions to access the directories.