You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by SRINIVAS SURASANI <va...@gmail.com> on 2011/08/19 20:27:55 UTC

Pig UDF compilation error

Hi,

Iam able to compile pig udf for pig-0.8.0 version . Its giving me an error
when I have tried compiling on pig-0.8.1 version.

following is the error message:

     cannot access org.apache.hadoop.io.WritableComparable
class file for org.apache.hadoop.io.WritableComparable not found
                       if ( input = null || input.size() = 0)
                                             ^

Any help apprecaited!

Thanks,
Srini

Re: Pig UDF compilation error

Posted by Thejas Nair <th...@hortonworks.com>.
> That being said, technically even with the bug, this will compile.

That won't even compile in Java, unless input is of type Boolean. But if 
it is of type boolean input.size() won't compile!
(But yeah, I have spent hours debugging a bug introduced by such a typo 
in C++ code)
-Thejas



>
> On Mon, Aug 22, 2011 at 6:40 AM, Jonathan Coveney<jc...@gmail.com>wrote:
>
>> It should be: input == null || input.size() == 0
>>
>> In java, = means variable assignment, whereas == is equality.
>>

Re: Pig UDF compilation error

Posted by Dmitriy Ryaboy <dv...@gmail.com>.
Nice catch of the bug, Jon.. hopefully this was a typo on Srini's part, not
actually in the code. Srini, did javac give you a filename and line number
to go with that error message?

That being said, technically even with the bug, this will compile. That's
not the issue Srini is encountering.
The issue is that he doesn't have hadoop jars on the classpath.

D

On Mon, Aug 22, 2011 at 6:40 AM, Jonathan Coveney <jc...@gmail.com>wrote:

> It should be: input == null || input.size() == 0
>
> In java, = means variable assignment, whereas == is equality.
>
> 2011/8/19 SRINIVAS SURASANI <va...@gmail.com>
>
> > Hi,
> >
> > Iam able to compile pig udf for pig-0.8.0 version . Its giving me an
> error
> > when I have tried compiling on pig-0.8.1 version.
> >
> > following is the error message:
> >
> >     cannot access org.apache.hadoop.io.WritableComparable
> > class file for org.apache.hadoop.io.WritableComparable not found
> >                       if ( input = null || input.size() = 0)
> >                                             ^
> >
> > Any help apprecaited!
> >
> > Thanks,
> > Srini
> >
>

Re: Pig UDF compilation error

Posted by Jonathan Coveney <jc...@gmail.com>.
It should be: input == null || input.size() == 0

In java, = means variable assignment, whereas == is equality.

2011/8/19 SRINIVAS SURASANI <va...@gmail.com>

> Hi,
>
> Iam able to compile pig udf for pig-0.8.0 version . Its giving me an error
> when I have tried compiling on pig-0.8.1 version.
>
> following is the error message:
>
>     cannot access org.apache.hadoop.io.WritableComparable
> class file for org.apache.hadoop.io.WritableComparable not found
>                       if ( input = null || input.size() = 0)
>                                             ^
>
> Any help apprecaited!
>
> Thanks,
> Srini
>