|
|
-
Decide if function is algebraic at planning phase
Ugljesa Stojanovic 2012-10-08, 19:01
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
+
Ugljesa Stojanovic 2012-10-08, 19:01
-
Re: Decide if function is algebraic at planning phase
Alan Gates 2012-10-09, 15:10
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
+
Alan Gates 2012-10-09, 15:10
-
Re: Decide if function is algebraic at planning phase
Ugljesa Stojanovic 2012-10-10, 13:18
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 > >
+
Ugljesa Stojanovic 2012-10-10, 13:18
-
Re: Decide if function is algebraic at planning phase
Ruslan Al-Fakikh 2012-10-09, 07:34
Hi!
Out of curiosity: what for? Algebraic works faster in most cases.
Possible solutions: 1) Maybe you can disable the use of combiner or something else that is related. Maybe if you change the Configuration to pig.exec.nocombiner=true that will disable the use of Algebraic, but I am not sure, that's just a thought 2) You can embed pig into Java or Python from where you can construct pig scripts pro grammatically, using the appropriate UDF implementation
Best Regards, Ruslan
On Mon, Oct 8, 2012 at 11:01 PM, Ugljesa Stojanovic <[EMAIL PROTECTED]> 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
+
Ruslan Al-Fakikh 2012-10-09, 07:34
|
|