配置单元:修改外部表的位置需要太长时间



Hive有两种表,分别是托管表和外部表,对于差异,您可以检查托管表。VS 外部表。

目前要将外部数据库从HDFS移动到Alluxio,我需要修改外部表的位置以alluxio://

该语句类似于:alter table catalog_page set location "alluxio://node1:19998/user/root/tpcds/1000/catalog_returns"

据我了解,应该是简单的元存储修改,但是对于一些表的修改,会花费几十分钟。数据库本身包含大约 1TB 的数据。

无论如何,我可以加速表更改过程吗?如果不是,为什么这么慢?欢迎任何评论,谢谢。

我找到了建议的方法,$HIVE_HOME/binmetatool

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.

通过使用此工具,位置修改非常快。(也许几秒钟。

将此线程留在这里,供可能遇到相同情况的任何人使用。

最新更新