You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by jamal sasha <ja...@gmail.com> on 2013/03/29 21:01:13 UTC

ignoring null entries

Hi,
  I have data as :
id1:string, value1:string
Sometimes id is missing so the data looks like:
foo,foobar
,foo1
foobar,bar1
,
....
I want to remove missing values
So the output should be
foo,foobar
foobar,bar1

How can I achieve this in pig (without using udf??)

Re: ignoring null entries

Posted by Harsha <ha...@defun.org>.
Hi Jamal, 
         you can use filter by not null .
 A = LOAD 'data_1' USING PigStorage(',') as (id1:chararray,value1:chararray);
 B = FILTER A by id1 is not null;   
 dump B;

-- 
Harsha


On Friday, March 29, 2013 at 1:01 PM, jamal sasha wrote:

> Hi,
> I have data as :
> id1:string, value1:string
> Sometimes id is missing so the data looks like:
> foo,foobar
> ,foo1
> foobar,bar1
> ,
> ....
> I want to remove missing values
> So the output should be
> foo,foobar
> foobar,bar1
> 
> How can I achieve this in pig (without using udf??)