You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sqoop.apache.org by Sedat Kestepe <sk...@gmail.com> on 2015/11/04 21:07:51 UTC

oozie sqoop write query result to a file

Hi,

I have an existing oozie job that makes a query on an Oracle table and
overwrite the result on hive tables.
Now I need to decide overwriting the hive table fi the query returns any
data.

My plan was to run a "select count(*) from..." style record count check.
Then write the output to a file, read the file in second action. There I
would put a decision action whether or not to run the main query and
overwrite hive table.

On the examples and documentation on web, target was to write the result on
a hive table. Actually this is the purpose of sqoop but I couldn't find any
thing related to writing the result in a file.

-- 
Sedat Kestepe

Re: oozie sqoop write query result to a file

Posted by Kristopher Kane <kk...@gmail.com>.
Sedat,

You could run your COUNT query in an Oozie shell or Java action and capture
the output to use in a decision tree inside Oozie. You would access this
count value from a key based on the echo output from Oozie shell or a key
from a Java properties class. Both are documented well in Oozie.

Kris

On Wed, Nov 4, 2015 at 3:07 PM, Sedat Kestepe <sk...@gmail.com> wrote:

> Hi,
>
> I have an existing oozie job that makes a query on an Oracle table and
> overwrite the result on hive tables.
> Now I need to decide overwriting the hive table fi the query returns any
> data.
>
> My plan was to run a "select count(*) from..." style record count check.
> Then write the output to a file, read the file in second action. There I
> would put a decision action whether or not to run the main query and
> overwrite hive table.
>
> On the examples and documentation on web, target was to write the result
> on a hive table. Actually this is the purpose of sqoop but I couldn't find
> any thing related to writing the result in a file.
>
> --
> Sedat Kestepe
>