java - 无法从 Hive 更改表位置
问题描述
我能够位于和Alluxio
之间的中间层,根据Running Apache Hive with Alluxio中的教程,我尝试从 Alluxio 为存储在 HDFS 中的现有表提供服务,因为我现在正在使用它来访问数据。
这里的关键步骤是将表位置从 HDFS 和 Ceph 等分布式存储系统修改为 alluxio:Ceph
Hive
external table
4.2. 将外部表从 HDFS 移动到 Alluxio 假设 Hive 中有一个现有的外部表 u_user,其位置设置为 hdfs://namenode_hostname:port/ml-100k。您可以使用以下 HiveQL 语句来检查其“Location”属性:
hive> desc 格式化的 u_user;
然后使用以下 HiveQL 语句将表数据位置从 HDFS 更改为 Alluxio:</p>hive> 更改表 u_user 设置位置“alluxio://master_hostname:port/ml-100k”;
我使用的语句是:
alter table call_center set location "alluxio://alluxio_master:19998/tpcds_text_1000.db/call_center";
但是,我收到如下错误:
ERROR ql.Driver: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. null
通过在 WARN 日志级别打开配置单元,我们获得了更多异常详细信息:
WARN [ main] metastore.RetryingMetaStoreClient: MetaStoreClient lost connection. Attempting to reconnect (1 of 1) after 1s. alter_table_with_environmentContext
org.apache.thrift.transport.TTransportException: null
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:86) ~[hive-exec-3.1.1.jar:3.1.1]
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:429) ~[hive-exec-3.1.1.jar:3.1.1]
当前call_center
表格信息如下:
# Detailed Table Information
Database: tpcds_text_1000
OwnerType: USER
Owner: root
Retention: 0
Location: s3a://tpcds/user/root/tpcds/1000/call_center
Table Type: EXTERNAL_TABLE
欢迎任何意见,谢谢。
解决方案
使用 Alluxio 运行 Apache Hive中的一些修改可能仅在重启 Metastore 后生效。
我杀死了元存储并重新启动它hive --service metastore
,然后成功修改了表位置。
将此线程留给可能遇到相同情况的任何人。
推荐阅读
- rxandroidble - 如何维护多个Activity之间的连接状态?
- html - :focus 环移除 :before 伪元素
- python - 在函数中使用 *args 并得到此错误:“预期的字符串或类似字节的对象”
- php - 如何使用可选参数向 laravel 路由添加 url 扩展?
- java - 如何使用 commons-dbcp BasicDataSource 为 getConnection 设置超时?
- reactjs - 无法编辑数字输入react.js
- java - 随机游走蒙特卡罗模拟
- node.js - node.js catch 块在等待时未按预期触发
- css - 在同一行中对齐表单输入
- docker - 是否可以运行一个接受私有图像的推送请求和来自 dockerhub 的代理图像的 habor 实例?