hive load数据后,数据被搬移,问题解决

现象:

1、我们先上传一个文件

$]hdfs dfs -put testdata.txt    /data/

2、hive 建表

hive>create external table if not exists data.testtable like dat.testtableori;

3、load数据

hive>load data inpath '/data/' into table testtable;

这时会发现在/data/目录下已经没有数据了

hive>dfs -ls /data/

原因:在没有指location时,hive load数据后将会搬移到缺省目录/user/hive/warehouse。

如果想装载数据后,不想移动数据,必须指定location ,是否成功,可用

hive>desc extended 表名;

查看设置是否正确



猜你喜欢

转载自blog.csdn.net/lepton126/article/details/80492679
今日推荐