You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Ian Holsman <kr...@gmail.com> on 2008/10/10 12:11:02 UTC

piggybank/register is there a better way?

So I have been watch (and using) Earl's latest patches with great joy
but I was wondering if there was a less cumbersome way of specifying the 
functions

for example


searchTerms = FOREACH row GENERATE org.apache.pig.piggybank.evaluation.util.apachelogparser.SearchTermExtractor(url);

vs

searchTerms = FOREACH row GENERATE SearchTermExtractor(url);

is there a way via introspection or something to make it so that we 
don't need to specify the full class path?

regards
Ian

Re: piggybank/register is there a better way?

Posted by Alan Gates <ga...@yahoo-inc.com>.
On Oct 10, 2008, at 7:18 PM, Ian Holsman wrote:

> Alan Gates wrote:
>> register piggybank.jar;
>> define SearchTermExtractor  
>> org.apache.pig.piggybank.evaluation.util.apachelogparser.SearchTermEx 
>> tractor();
>> ...
>> searchTerms = FOREACH row GENERATE SearchTermExtractor(url);
>
> Is there a way for the function itself to do the 'define' when it  
> registers itself?

No, and it isn't clear to me that you'd want such a thing.  It seems  
like it would create name space conflicts that might be unresolvable.

Alan.


Re: piggybank/register is there a better way?

Posted by Ian Holsman <li...@holsman.net>.
Alan Gates wrote:
> register piggybank.jar;
> define SearchTermExtractor 
> org.apache.pig.piggybank.evaluation.util.apachelogparser.SearchTermExtractor(); 
>
> ...
> searchTerms = FOREACH row GENERATE SearchTermExtractor(url);

Is there a way for the function itself to do the 'define' when it 
registers itself?
>
> On Oct 10, 2008, at 3:11 AM, Ian Holsman wrote:
>
>> So I have been watch (and using) Earl's latest patches with great joy
>> but I was wondering if there was a less cumbersome way of specifying 
>> the functions
>>
>> for example
>>
>>
>> searchTerms = FOREACH row GENERATE 
>> org.apache.pig.piggybank.evaluation.util.apachelogparser.SearchTermExtractor(url); 
>>
>>
>> vs
>>
>> searchTerms = FOREACH row GENERATE SearchTermExtractor(url);
>>
>> is there a way via introspection or something to make it so that we 
>> don't need to specify the full class path?
>>
>> regards
>> Ian
>
>


Re: piggybank/register is there a better way?

Posted by Alan Gates <ga...@yahoo-inc.com>.
register piggybank.jar;
define SearchTermExtractor  
org.apache.pig.piggybank.evaluation.util.apachelogparser.SearchTermExtra 
ctor();
...
searchTerms = FOREACH row GENERATE SearchTermExtractor(url);

On Oct 10, 2008, at 3:11 AM, Ian Holsman wrote:

> So I have been watch (and using) Earl's latest patches with great joy
> but I was wondering if there was a less cumbersome way of  
> specifying the functions
>
> for example
>
>
> searchTerms = FOREACH row GENERATE  
> org.apache.pig.piggybank.evaluation.util.apachelogparser.SearchTermExt 
> ractor(url);
>
> vs
>
> searchTerms = FOREACH row GENERATE SearchTermExtractor(url);
>
> is there a way via introspection or something to make it so that we  
> don't need to specify the full class path?
>
> regards
> Ian