I tried the following

oozie sqoop -oozie http://localhost:11000/oozie -command import --connect
jdbc:mysql://localhost:3306/rainfall --username root --password "" --query
"SELECT * FROM table WHERE (year\=\$YEAR AND month\=\$MONTH) AND
\$CONDITIONS" --target-dir '/user/output_freeform' -m 1 -config
job.properties

This breaks with following as definition generated

      <arg>--query</arg>
      <arg>SELECT * FROM rainfall.rainfall_data WHERE (year\</arg>
      <arg>$YEAR AND month\</arg>
      <arg>$MONTH) AND $CONDITIONS</arg>

On Mon, Sep 7, 2015 at 4:31 AM, Technology <[email protected]>
wrote:

> Try using escape operators, something like \=.
>
> Thanks & Regards,
> Kiran Thati
> Sent from my iPhone
>
> > On Sep 5, 2015, at 5:58 AM, Jagat Singh <[email protected]> wrote:
> >
> > Hi,
> >
> > How to parse this query properly with the command line.
> >
> > oozie sqoop -oozie http://localhost:11000/oozie -command import
> --connect
> > jdbc:mysql://localhost:3306/db --username root --password "" --query
> > "SELECT * FROM table WHERE (year=2015 AND month=01) AND \$CONDITIONS"
> > --target-dir '/output' -m 1 -config job.properties
> >
> > The query breaks at place where it sees first = after YEAR.
> >
> > The generated workflow is
> >
> >      <arg>--query</arg>
> >      <arg>SELECT * FROM table WHERE (year</arg>
> >      <arg>2015 AND month</arg>
> >      <arg>01) AND $CONDITIONS</arg>
> >
> > Thanks,
> >
> > Jagat Singh
>

Reply via email to