Search code examples
hadoophiveooziehue

In Oozie, how can I redirect the output of a query to a file?


In Oozie, I have used Hive action in Hue. and I want to redirect the output of the query to a file. How can I generate those file?

My HQL is : select * from emptable where day>=${fromdate} and day<=${todate}

My HiveServer Action contains: a. HQL script b. Two parameters options one for each dates like as fromdate = , todate = c. Added file hive-site.xml.

My question is how can I redirect the output of a query to a file


Solution

  • You would need to execute the Shell action which is not recommended, a better solution might be to do a

    INSERT OVERWRITE DIRECTORY '/path' SELECT * FROM TABLE