Reputation: 137
I am using cloudera and I run the query in hive
insert overwrite local directory '/home/cloudera/Documents/test' row
format delimited fields terminated by ',' select * from stocks sort
by close desc;
But I gives me the error which is
Copying data to local directory /home/cloudera/Documents/test
Failed with exception Unable to delete the existing destination
directory: /home/cloudera/Documents/test
FAILED: Execution Error, return code 1 from
org.apache.hadoop.hive.ql.exec.MoveTask
Upvotes: 1
Views: 729
Reputation: 709
The user that executes the command needs to have write permissions on the parent directory, in this case /home/cloudera/Documents, to delete the whole directory and create a new one. Furthermore the user needs to have the write permission to delete all files currently present in the directory.
To make sure that this should work you can:
If this works the query will work. If it doesn't you need to check which particular permission setting is messing with your plan.
Upvotes: 2