|
|
abhishek dodda 2012-10-03, 00:04
hi all,
I am fairly new to pig.Can any one tell me how to write below hive query in pig latin.
In this query iam using Cartesian join to achieve instring or contains in java.
Example
col1 -- 145678341212
col2 -- %67834%
insert into table t1
select t2.col1, t3.col2
from table2 t2
join table3 t3
WHERE t3.col2 IS NOT NULL
AND t2.col1 LIKE CONCAT(CONCAT('%',t3.col2),'%')
Regards abhi
Abhishek 2012-10-12, 14:05
Hi all,
How to Hive coalesce statement in pig
Example:
Case when Coalesce(x,0.00)=0.00 then y else z
How to write this in pig
Regards Abhi
Arun Ahuja 2012-10-12, 15:26
>From my interpretation Hive coaelsce returns the first non-null value.
So it seems you are just doing a null check on x and return y if it is null and z otherwise?
In Pig you could do something like --- " (x is null ? y : z) This a standard ternary if/else. Don't see if the 0.00 actually plays any other role than the null check, right?
On Fri, Oct 12, 2012 at 10:05 AM, Abhishek <[EMAIL PROTECTED]> wrote: > Hi all, > > How to Hive coalesce statement in pig > > Example: > > Case when > Coalesce(x,0.00)=0.00 then y else z > > How to write this in pig > > Regards > Abhi
Abhishek 2012-10-12, 16:54
Thanks Arun you are right.
Sent from my iPhone
On Oct 12, 2012, at 11:26 AM, Arun Ahuja <[EMAIL PROTECTED]> wrote:
> From my interpretation Hive coaelsce returns the first non-null value. > > So it seems you are just doing a null check on x and return y if it is > null and z otherwise? > > In Pig you could do something like --- " (x is null ? y : z) This a > standard ternary if/else. Don't see if the 0.00 actually plays any > other role than the null check, right? > > On Fri, Oct 12, 2012 at 10:05 AM, Abhishek <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> How to Hive coalesce statement in pig >> >> Example: >> >> Case when >> Coalesce(x,0.00)=0.00 then y else z >> >> How to write this in pig >> >> Regards >> Abhi
|
|
All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by
Sematext