Hi Ranjan,

Do you mean the tuples all have 3 fields, with the 2nd and 3rd being
chararrays? Please take a look at bincond (
http://pig.apache.org/docs/r0.9.1/basic.html), it might be something you
are looking for.

A = load 'input' as (f1, f2, f3);
B = foreach A generate (f1 is null? f1 : CONCAT(f2, f3);     /** Assuming
f2 and f3 are char/bytearrays. Else handle it however you would like to
combine)

Thanks,
Prashant


On Mon, Feb 13, 2012 at 10:47 AM, Ranjan Bagchi <[email protected]>wrote:

> Hi,
>
> I'm processing a set of log files and trying to do some simple data
> cleaning on them.  It's of the form:  given a tuple, if value 1 isn't null,
> use it, otherwise combine values 2 and 3.  This is pretty simple default
> stuff.
>
> Is this even expressable in pig latin?  Or do I need to write a UDF?
>
> Thanks,
>
> Ranjan

Reply via email to