在 Hortonworks (HDP) 到 Cloudera (CDP) 迁移后无法创建托管 Hive Table

Unable to create Managed Hive Table after Hortonworks (HDP) to Cloudera (CDP) migration

作为从 Hortonworks 数据平台 (HDP v3.x) 迁移到 Cloudera 数据平台 (CDP) 7.1 版的一部分,我们正在测试我们的 Hadoop 应用程序。测试时,我们在尝试创建 Managed Hive Table 时发现了以下问题。请告知可能的解决方案。谢谢!

Error: Error while compiling statement: FAILED: Execution Error, return code 40000 from org.apache.hadoop.hive.ql.ddl.DDLTask. MetaException(message:A managed table's location should be located within managed warehouse root directory or within its database's managedLocationUri. Table MANAGED_TBL_A's location is not valid:hdfs://cluster/prj/Warehouse/Secure/APP/managed_tbl_a, managed warehouse:hdfs://cluster/warehouse/tablespace/managed/hive) (state=08S01,code=40000)

DDL 脚本

create table if not exists MANAGED_TBL_A
(
   name string,
   id varchar(20),
   created_on TIMESTAMP,
   created_by VARCHAR(10)
)
partitioned by (partition_date varchar(20))
clustered by (id) into 5 buckets
stored as orc
location '/prj/Warehouse/Secure/APP/managed_tbl_a'
tblproperties ('compactorthreshold.hive.compactor.delta.num.threshold'='1','compactorthreshold.hive.compactor.delta.pct.threshold'='0.5','transactional'='true','orc.create.index'='true','orc.compress.size'='8192');

hive.metastore.warehouse.dir - 是仓库根目录。

创建数据库时,指定 MANAGEDLOCATION - 托管表的位置根和 LOCATION - 外部表的根。

MANAGEDLOCATIONhive.metastore.warehouse.dir

之内

metastore.warehouse.tenant.colocation 属性 设置为 true 允许托管表 (MANAGEDLOCATION) 在仓库根目录之外的公共位置,为设置配额和提供基于租户的公共根目录其他政策。

在本手册中查看更多详细信息:Hive managed location