Hortonworks (HDP) 到 Cloudera (CDP) 迁移后无法创建托管 Hive 表 [英] Unable to create Managed Hive Table after Hortonworks (HDP) to Cloudera (CDP) migration

查看:46
本文介绍了Hortonworks (HDP) 到 Cloudera (CDP) 迁移后无法创建托管 Hive 表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

We are testing our Hadoop applications as part of migrating from Hortonworks Data Platform (HDP v3.x) to Cloudera Data Platform (CDP) version 7.1. While testing, we found below issue while trying to create Managed Hive Table. Please advise on possible solutions. Thank you!

错误:编译语句时出错:失败:执行错误,从 org.apache.hadoop.hive.ql.ddl.DDLTask 返回代码 40000.MetaException(消息:托管表的位置应位于托管仓库根目录或其数据库的 managedLocationUri 内.表 MANAGED_TBL_A 的位置无效:hdfs://cluster/prj/Warehouse/Secure/APP/managed_tbl_a, 托管仓库:hdfs://cluster/warehouse/tablespace/managed/hive) (state=08S01,code=40000)

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 - 外部表的根目录.

When you create the database, specify MANAGEDLOCATION - a location root for managed tables and LOCATION - root for external tables.

MANAGEDLOCATION 位于 hive.metastore.warehouse.dir

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

Setting the metastore.warehouse.tenant.colocation property to true allows a common location for managed tables (MANAGEDLOCATION) outside the warehouse root directory, providing a tenant-based common root for setting quotas and other policies.

在本手册中查看更多详细信息:Hive 管理位置.

See more details in this manual: Hive managed location.

这篇关于Hortonworks (HDP) 到 Cloudera (CDP) 迁移后无法创建托管 Hive 表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆