在配置单元中创建外部 table 时更改默认位置

change default location when creating an external table in hive

我想从 viewhive 中创建一个 external table 并更改默认值 location:

CREATE external TABLE market.resultats like v_ca_mag
LOCATION '/user/training/market/db/resultats';

table 已创建并且 externallocation 是默认 /user/hive/warehouse/market.db/resultats

为什么不考虑location

我正在使用 cdh 5.4

可能是一个错误,请打开一个 jira 来解决这个问题。

一旦你完成创建外部table然后执行alter table语句来改变位置您新创建的table到所需位置

hive> CREATE external TABLE market.resultats like v_ca_mag;
hive> alter table market.resultats set location 'hdfs://nnaddress/user/training/market/db/resultats';