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 >> Conditional execution of 'generate' clauses


Copy link to this message
-
Conditional execution of 'generate' clauses
Hi Folks,

I came across a use case where I'd like to do something like this:

FOREACH X {
   ...
   t = DISTINCT (...)
   if (!IsEmpty(t))
      GENERATE foo, ...
}

Thus, 'generate' is conditionally executed and the control flow depends on
the value of some tuple 't'.
Can this be done in pig?

Thanks,

stan

P.S. Please ignore my previous email; I accidentally triggered send before I
had a chance to finish it.
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