hive使用load加载数据到表中

版权声明:本文为博主九师兄(QQ群:spark源代码 198279782 欢迎来探讨技术)原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_21383435/article/details/82631964

创建表

create table test2 (id int,name string)row format delimited fields terminated by ','; 

load本地数据到表

load data local inpath "/inceptor1/tmp/bb.txt" overwrite into table test;

load远程hdfs数据到表

load data  inpath "/inceptor1/tmp/bb.txt" overwrite into table test;

区别:一个没带local

报错集锦

报错1

Failed with exception Unable to move source hdfs://maeter:8000/usr/local/hadoop/input/test_hive/test

是因为hive执行的时候,对hdfs的访问权限不够
执行:

 hadoop fs -chmod -R 755 /tmp
 hadoop fs -chmod -R  777/usr

猜你喜欢

转载自blog.csdn.net/qq_21383435/article/details/82631964