In hive,can we change location of managed/external table

↘锁芯ラ 提交于 2019-12-02 06:54:16

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/46361835/in-hive-can-we-change-location-of-managed-external-table

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!