在蜂巢中,我们可以更改托管/外部表的位置吗?

问题描述:

在配置单元中,我们可以更改托管/外部表的位置吗? 如果是的话.更改位置后,其行为将类似于外部表或内部表

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