在 hive 中,我们可以更改托管/外部表的位置吗 [英] In hive,can we change location of managed/external table

查看:28
本文介绍了在 hive 中,我们可以更改托管/外部表的位置吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 hive 中,我们可以更改托管/外部表的位置吗如果是的话如何.更改位置后,它的行为会像外部表还是内部表

In hive,can we change location of managed/external table if yes how. After changing location will it behave like external table or internal table

推荐答案

我试图搜索这个问题,但没有得到正确的答案是的,如果我们添加位置

I tried to search this question but I didnt get a proper answer yes we can change the location of managed table if we add location

CREATE TABLE weather (wban INT, date STRING, precip INT)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ‘,’
LOCATION ‘ /hive/data/weather’;

创建后,我们可以通过以下命令更改位置

After creation we can change location by the below command

ALTER (DATABASE|SCHEMA) database_name SET LOCATION hdfs_path

即使我们更改位置,该表也将仅作为托管表运行

Even if we change the location the table will behave as managed table only

这篇关于在 hive 中,我们可以更改托管/外部表的位置吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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