Hadoop Hive unable to move source to destination

2019-02-07 09:15发布

I am trying to use Hive 1.2.0 over Hadoop 2.6.0. I have created an employee table. However, when I run the following query:

hive> load data local inpath '/home/abc/employeedetails' into table employee;

I get the following error:

Failed with exception Unable to move source file:/home/abc/employeedetails to destination hdfs://localhost:9000/user/hive/warehouse/employee/employeedetails_copy_1
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask

What wrong am I doing here? Are there any specific permissions that I need to set? Thanks in advance!

4条回答
干净又极端
2楼-- · 2019-02-07 09:23

The error might be due to permission issue on local filesystem.

Change the permission for local filesystem:

sudo chmod -R 777 /home/abc/employeedetails

Now, run:

hive> load data local inpath '/home/abc/employeedetails' into table employee;
查看更多
叛逆
3楼-- · 2019-02-07 09:25

See the permission for the HDFS directory:

hdfs dfs -ls /user/hive/warehouse/employee/employeedetails_copy_1

Seems like you may not have permission to load data into hive table.

查看更多
Summer. ? 凉城
4楼-- · 2019-02-07 09:38

As mentioned by Rio, the issue involved lack of permissions to load data into hive table. I figures out the following command solves my problems:

hadoop fs -chmod g+w /user/hive/warehouse
查看更多
做自己的国王
5楼-- · 2019-02-07 09:45

If we face same error After running the above command in distributed mode, we can try the the below cammand in all super users of all nodes. sudo usermod -a -G hdfs yarn Note:we get this error after restart the all the services of YARN(in AMBARI).My problem was resolved.This is admin command better to care when you are running.

查看更多
登录 后发表回答