sqoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abraham Elmahrek <...@cloudera.com>
Subject Re: Sqoop eval function
Date Mon, 30 Dec 2013 21:25:30 GMT
Sorry,

To be more clear... you should be able to do something like:

MYVAL=$(sqoop-eval -query "SELECT COUNT(*) FROM test" ... |  awk
'/([0-9]+)/{print $2}')

or

MYVAL=$(sqoop-eval -query "SELECT COUNT(*) FROM test" ... |  grep -Po "\d+")

-Abe


On Mon, Dec 30, 2013 at 1:17 PM, Abraham Elmahrek <abe@cloudera.com> wrote:

> Hey There,
>
> The Sqoop eval command is more for verification and preview purposes than
> actual usage. With that being said... you can definitely pipe the result of
> sqoop eval into a file and perform what ever formatting you see fit (ie
> with AWK).
>
> -Abe
>
>
> On Mon, Dec 30, 2013 at 2:09 AM, yogesh kumar <yogeshsqoop@gmail.com>wrote:
>
>> Hello all,
>>
>> I am doing some select operation with sqoop evel function. like
>>
>> sqoop eval -libjars ..
>> --query "select max(salary) from employe where dept = HR"
>> -- username abc
>> --password abc
>>
>>
>> Its working fine, I want to store the result of this query into a unix
>> shell script variable..
>>  for using this vale for further operations...
>>
>>
>> Pls help and suggest how to stroe the value into a vriable.
>>
>> Thanks & Regards
>> Yogesh Kumar
>>
>>
>
>

Mime
View raw message