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 2012/11/15 16:53:46 UTC

bincod evaluation

Hi,

  I am trying to replace missing values with a precomputed value.

But I am getting an error.

So here is my code:



Input = LOAD ‘data.txt’ USING PigStorage(‘,) AS (id1:double, id2:double);

Ginput = foreach Input generate

id1 IS NULL ?  2 : id1,

id2 IS NULL ? 42 : id2;



I am getting the error

2012-11-15 08:22:16,079 [main] ERROR org.apache.pig.tools.grunt.Grunt -
ERROR 1200: <file replace_mean.pig, line 15, column 3>  mismatched input
'IS' expecting semi column
Thanks

Re: bincod evaluation

Posted by Cheolsoo Park <ch...@cloudera.com>.
Hi Jamal,

Please try:

Ginput = foreach Input generate (id1 IS NULL ?  2 : id1), (id2 IS NULL ? 42
: id2);

This is a known issue:
https://issues.apache.org/jira/browse/PIG-2595

Thanks,
Cheolsoo

On Thu, Nov 15, 2012 at 7:53 AM, jamal sasha <ja...@gmail.com> wrote:

> Hi,
>
>   I am trying to replace missing values with a precomputed value.
>
> But I am getting an error.
>
> So here is my code:
>
>
>
> Input = LOAD ‘data.txt’ USING PigStorage(‘,) AS (id1:double, id2:double);
>
> Ginput = foreach Input generate
>
> id1 IS NULL ?  2 : id1,
>
> id2 IS NULL ? 42 : id2;
>
>
>
> I am getting the error
>
> 2012-11-15 08:22:16,079 [main] ERROR org.apache.pig.tools.grunt.Grunt -
> ERROR 1200: <file replace_mean.pig, line 15, column 3>  mismatched input
> 'IS' expecting semi column
> Thanks
>