Reply
Highlighted
Explorer
Posts: 16
Registered: ‎11-27-2017
Accepted Solution

Failed to execute hive queries [ Access denied: Unable to move source to destination]

I am trying to build pipeline using STREAMSETS which would be pushing records into HDFS and then hive Query will execute .

I running query load data inpath '/path/in/hdfc' into  table table_name .getting the exception..

 

Failed to execute queries. Details : Failed to execute query 'load data inpath 
'/tmp/out/*' into table smsc_data_main_nw_success'. Reason: java.sql.SQLException:
Error while processing statement: FAILED: Execution Error,
return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask.
org.apache.hadoop.hive.ql.metadata.HiveException:
Access denied: Unable to move source hdfs://hostname:8020/tmp/out/file_name.done to
destination hdfs://hostname:8020/user/hive/warehouse/test.db/table_name:
Permission denied by sticky bit: user=anonymous,
path="/tmp/out/file_name.done":amank:supergroup:-rw-rw-r--,
parent="/tmp/out":amank:supergroup:drwxrwxrwt

I tried to these steps

hadoop fs -chmod g+w /user/hive/warehouse/test.db

 but still facing the same issue.

Posts: 1,748
Kudos: 364
Solutions: 277
Registered: ‎07-31-2013

Re: Failed to execute hive queries [ Access denied: Unable to move source to destination]

> user=anonymous

It appears that your query connects without a proper username supplied. If
this is a HiveServer2 based connection, ensure you provide a username in
the connection string. This would be the simplest way to resolve your
issue, typically done by adding "user=username" as a property in the
connection string.

If you absolutely do wish to use anonymous, then ensure that you use a non
/tmp path with 777 (but no sticky bit) access to the parent directory, so
that the user 'anonymous' is allowed to remove files from that directory.
This breaks down security, so is not advisable as a long term solution.
Explorer
Posts: 16
Registered: ‎11-27-2017

Re: Failed to execute hive queries [ Access denied: Unable to move source to destination]

Thank you ,that works!!

Announcements