What happens when you just go  "FOREACH bar GENERATE
mypack.myfunc(COUNT(something))" ?

On Sun, Jan 2, 2011 at 3:30 PM, Andreas Paepcke <[email protected]> wrote:

> Hi,
>
> I'm confused by the following:
>
>
> foo = FOREACH bar {
>              theSize = COUNT(something);
>              GENERATE mypack.myfunc(theSize);
>              }
>
> It seems that 'theSize' does not get typed, leading
> to "java.lang.ClassCastException: java.lang.String cannot be cast to
> org.apache.pig.data.DataBag"
>
> When I replace 'theSize' in the myfunc() call
> with a number (which myFunc() expects), all
> works well. myFunc() gets called.
>
> Where am I going wrong?
>
> Thanks!
>
> Andreas
>

Reply via email to