Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Writing data into files from hive queries

Writing data into files from hive queries

Hi,

 

when i am executing the query 

"insert overwrite local directory '/home/cloudera/order/' stored as textfile select o.id, o.status from order o"

 

its throwing the below error.

Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask

 

but this query retured the result for the hdfs directory.

 

need help to resolve this.

 

Thanks,

Rupesh 

 

3 REPLIES 3

Re: Writing data into files from hive queries

Champion

@rupeshverma88

 

For local path, use the format:
file:///home/username

 

For HDFS path, use the format:
hdfs://<hostname>:8020/user/username  (or) /user/username 

Highlighted

Re: Writing data into files from hive queries

Hi @saranvisa,

 

got the same error while executing the below query.

 

insert overwrite local directory 'file:///o' stored as textfile
select o1.id ,o1.name from o as o1;

 

Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask

 

Thanks,

Rupesh verma

Re: Writing data into files from hive queries

Champion

@rupeshverma88

 

Then you need to check the ID which is executing the query has access to the local folder that you have mention. If your answer is yes then get more details from log because the shared info is very generic

Don't have an account?
Coming from Hortonworks? Activate your account here