Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig, mail # user - Non static nested Algebraic functions and their constructor


Copy link to this message
-
Re: Non static nested Algebraic functions and their constructor
Dmitriy Ryaboy 2012-10-11, 17:54
Yeah.. Joys of reflection.
Note that if you are writing algebraics against pig 0.11 you probably
want to extend AlgebraicEvalFunc -- that gives you the normal exec()
and the accumulative implementation for free.

D

On Wed, Oct 10, 2012 at 10:20 AM, Ugljesa Stojanovic <[EMAIL PROTECTED]> wrote:
> Yeah i managed to figure the first thing out :) And you are right about the
> constructor being called during the planning phase, but still it is kind of
> annoying to have to implement it even if I never use it.
>
> Ugljesa
>
> On Wed, Oct 10, 2012 at 6:25 PM, Gianmarco De Francisci Morales <
> [EMAIL PROTECTED]> wrote:
>
>> In Java nested classes need to be static if you want to use them as normal
>> outer classes.
>> Otherwise your are implicitly defining a field with type of the nested
>> class in the outer class.
>>
>> If I am not wrong, it is possible that the empty constructor is called
>> during the plan generation phase.
>>
>> Cheers,
>> --
>> Gianmarco
>>
>>
>>
>> On Wed, Oct 10, 2012 at 6:38 AM, Ugljesa Stojanovic <[EMAIL PROTECTED]
>> >wrote:
>>
>> > Kind of resolved... If it's a nested class it has to be static but I
>> still
>> > see the empty constructor being called multiple times but after that it
>> > seems to call the correct one.
>> >
>> > On Wed, Oct 10, 2012 at 3:17 PM, Ugljesa Stojanovic <[EMAIL PROTECTED]
>> > >wrote:
>> >
>> > > Not sure if this is a noob question but I've been digging quite a lot
>> and
>> > > trying different things and I just can't seem to use a non static class
>> > for
>> > > Initial/Intermed/Final getters or use constructors for them. Can this
>> be
>> > > done and how?
>> > >
>> > > Regards,
>> > > Ugljesa
>> > >
>> >
>>