sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darq Moth <darqm...@gmail.com>
Subject Re: Import: Specify `select` expression in a separate file?
Date Fri, 21 Mar 2014 10:28:44 GMT
Command line:
sqoop import --connect jdbc:mysql://server/db --username xxxx --password
yyyy --options-file sql.txt --target-dir /data/test -m 1 --null-string
'\\N' --null-non-string '\\N' --hive-import --hive-table phone

where sql.txt contains:
--query select mobile, name where \$CONDITIONS from test

does not work. What is wrong? -

I tried putting different argument combinations in optios-file, all result
in general error message from Sqoop. It would help if you could post an
example of using options-file to pass select expression that works for you.


On Tue, Mar 18, 2014 at 7:35 PM, Jarek Jarcec Cecho <jarcec@apache.org>wrote:

> Are you perhaps looking for --options-file option?
>
>
> http://sqoop.apache.org/docs/1.4.4/SqoopUserGuide.html#_using_options_files_to_pass_arguments
>
> Jarcec
>
> On Tue, Mar 18, 2014 at 05:34:41PM +0400, Darq Moth wrote:
> > Hello,
> > When importing data from MySQL to Hive I need to normalize several text
> > fields containing phone numbers. This requires quite complex logic which
> is
> > hard to express in Sqoop command line with a single SQL replace function.
> > Is it possible to specify SQL select expressions in a separate file and
> > refer to it from a command line?
> >
> > Thanks!
>

Mime
View raw message