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 Threaded View
Pig >> mail # user >> define global constants in pig script


Copy link to this message
-
Re: define global constants in pig script
Pig already has this! :)
http://pig.apache.org/docs/r0.10.0/cont.html#parameter-sub

Unless I'm really misunderstanding what you mean?

2012/7/26 Haitao Yao <[EMAIL PROTECTED]>

> Hi, all
>         I got an idea about a new feature for pig: define global constants
> in pig script.
>         Here's the example like this:
>
> -- define a global constant for storage
> define store_location "/where_you_store_result";
>
> -- then all the following constants reference will be replaced in runtime
> store Result into $$store_location using PigStorage(',');
>
>
>         so, in this way, we just write the template scripts and import
> them with the constants defined. A commonly use case is use it to compute
> data for different days.
>         Without this feature, I have to use sed to replace the variables
> on the template script to generate the daily pig scripts.
>         How do you guy think so?
>
>
> Haitao Yao
> [EMAIL PROTECTED]
> weibo: @haitao_yao
> Skype:  haitao.yao.final
>
>
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