You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Jagat Singh <ja...@gmail.com> on 2015/09/05 11:58:59 UTC
Sqoop command line free form
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
Re: Sqoop command line free form
Posted by Jagat Singh <ja...@gmail.com>.
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 <ki...@gmail.com>
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 <ja...@gmail.com> 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
>
Re: Sqoop command line free form
Posted by Technology <ki...@gmail.com>.
Try using escape operators, something like \=.
Thanks & Regards,
Kiran Thati
Sent from my iPhone
> On Sep 5, 2015, at 5:58 AM, Jagat Singh <ja...@gmail.com> 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