Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> Best Practice: How to encapsulate frequently used native pig code to "methods"


+
Markus Resch 2012-03-14, 12:41
Copy link to this message
-
Re: Best Practice: How to encapsulate frequently used native pig code to "methods"
Pig has support for macros; take a look at DEFINE (macro) and IMPORT here:

http://pig.apache.org/docs/r0.9.1/cont.html#define-macros

Norbert

On Wed, Mar 14, 2012 at 8:41 AM, Markus Resch <[EMAIL PROTECTED]>wrote:

> Hi everyone,
>
> In future we are going to have a bunch of Pig scripts in parallel which
> are doing different stuff. In front of that special code we are going to
> have a very common "pre-filtering part" which I don't like to copy
> manually all over. I also don't like to use UDFs (as long as I can avoid
> them) because of my concerns about the optimization. I think I can doo
> all that filtering in native Pig code.
> What is the most common way to encapsulate such stuff in some kind of
> "methods" wich are returning relations just like the native calls do?
>
>
> Thanks
>
> Markus
>
>
>
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB