hive:修改外部表的位置花费的时间太长

zour9fqk  于 2021-05-29  发布在  Hadoop
关注(0)|答案(1)|浏览(400)

hive有两种表,一种是托管表,另一种是外部表,您可以选中托管表。vs外部表。
当前,要从 HDFSAlluxio ,我需要将外部表的位置修改为 alluxio:// .
这种说法类似于: alter table catalog_page set location "alluxio://node1:19998/user/root/tpcds/1000/catalog_returns" 根据我的理解,这应该是一个简单的元存储修改,然而,对于一些表的修改,它将花费几十分钟。数据库本身包含大约1tb的数据。
我是否需要加快表更改过程?如果没有,为什么这么慢?欢迎评论,谢谢。

wljmcqd8

wljmcqd81#

我找到了建议的方法 metatool 低于 $HIVE_HOME/bin .

metatool -updateLocation <new-loc> <old-loc>      Update FS root location in the
                                          metastore to new location.Both
                                          new-loc and old-loc should be
                                          valid URIs with valid host names
                                          and schemes.When run with the
                                          dryRun option changes are
                                          displayed but are not persisted.
                                          When run with the
                                          serdepropKey/tablePropKey option
                                          updateLocation looks for the
                                          serde-prop-key/table-prop-key
                                          that is specified and updates
                                          its value if found.

通过使用该工具,位置修改速度非常快(可能几秒钟。)
把这条线索留给可能遇到同样情况的人。

相关问题