In hive,can we change location of managed/external

2019-02-27 10:19发布

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

标签: hive hiveql
1条回答
聊天终结者
2楼-- · 2019-02-27 11:02

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

查看更多
登录 后发表回答