Reply
Explorer
Posts: 8
Registered: ‎01-08-2017

Writing data into files from hive queries

[ Edited ]

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 

 

Highlighted
Posts: 519
Topics: 14
Kudos: 91
Solutions: 45
Registered: ‎09-02-2016

Re: Writing data into files from hive queries

@rupeshverma88

 

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

 

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

Explorer
Posts: 8
Registered: ‎01-08-2017

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

Posts: 519
Topics: 14
Kudos: 91
Solutions: 45
Registered: ‎09-02-2016

Re: Writing data into files from hive queries

@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