t; if(max(if(f3='N',f5,null)) is null,0,max(if(f3='N',f5,null))) nf5
>>from mytable
>>group by f1, f2;
>>
>>
>>
>> From: Edward Capriolo
>>To: "user@hive.apache.org"
>>Sent: Saturday, June 22, 2013 7:48
'N',f5,null)) is null,0,max(if(f3='N',f5,null))) nf5
>> from mytable
>> group by f1, f2;
>>
>>
>>*From:* Edward Capriolo
>> *To:* "user@hive.apache.org"
>> *Sent:* Saturday, June 22, 2013 7:48 PM
>> *Subjec
ll,0,max(if(f3='N',f5,null))) nf5
> from mytable
> group by f1, f2;
>
>
>*From:* Edward Capriolo
> *To:* "user@hive.apache.org"
> *Sent:* Saturday, June 22, 2013 7:48 PM
> *Subject:* Re: how to combine some rows into 1 row in hive
>
> Using hives s
@hive.apache.org"
Sent: Saturday, June 22, 2013 7:48 PM
Subject: Re: how to combine some rows into 1 row in hive
Using hives streaming feature is a nice option for this as it is a fairly
natural way to work with entire rows and return multiple columns
select transform a,b,c,d using
Thanks!
Can you be specific with code examples?
On Sat, Jun 22, 2013 at 4:48 PM, Edward Capriolo wrote:
> Using hives streaming feature is a nice option for this as it is a fairly
> natural way to work with entire rows and return multiple columns
>
> select transform a,b,c,d using /bin/pipeprog
Using hives streaming feature is a nice option for this as it is a fairly
natural way to work with entire rows and return multiple columns
select transform a,b,c,d using /bin/pipeprogram as a, b ,c ,d
You an also write a UDTF user defined Table function as well because this
can return more then
I have the following table:
f1 f2 f3 f4 f5
a1 a2 P x1 x2
a1 a2 N x3 x4
a1 a3 N x5 x6
a4 a6 P x7 x8
i want to convert to below:
f1 f2 pf4 pf5 nf4 nf5
a1 a2 x1 x2 x3 x4
a1 a3 0 0 x5 x6
a4 a6 x7 x8 0 0
basically, when f3="P", I want f4 f5 to be moved to pf4 pf5
when f3="N", i want f4 f5 to be moved