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

Switch to Threaded View
Pig >> mail # user >> Decide if function is algebraic at planning phase

Copy link to this message
Re: Decide if function is algebraic at planning phase
Thanks Alan, funcToArgMapping did the trick :)

On Tue, Oct 9, 2012 at 5:10 PM, Alan Gates <[EMAIL PROTECTED]> wrote:

> There is one way you could shoe-horn this in.  EvalFuncs can implement
> funcToArgMapping, which is built to allow functions to pick a different
> instance of themselves for different types (e.g. SUM(long) vs SUM(double)).
>  You could implement your logic in this function and then return an
> EvalFunc with or without Algebraic implemented based on your choice.
> Alan.
> On Oct 8, 2012, at 12:01 PM, Ugljesa Stojanovic wrote:
> > I would like to be able to decide if I want to use the Algebraic or
> regular
> > implementation of an EvalFunc on the front end (planning phase),
> preferably
> > in the function constructor. Is there any way to do this? If I implement
> > the interface the planner will automatically attempt to use it. Returning
> > null when implementing it in those cases also doesn't work.
> >
> > Thanks,
> > Ugljesa