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 >> Problem in understanding UDF COUNT


Copy link to this message
-
Re: Problem in understanding UDF COUNT
That is confusing and that is something that William Dowling explained an
email blow.

The scope of the alias b has changed. Now when used with 'for each' on c,
the alias/variable b will be used just to count what belongs to the current
c.

Imagine that b although is a bag of all the records but when passed to the
count function in 'for each c', only those items/records are filtered or
counted which belong to the current c.

Take a look at this link that I sent earlier (especially the age_counts
example):
http://squarecog.wordpress.com/2010/05/11/group-operator-in-apache-pig/

It does not explain everything but it is a more detailed example with
comments and perhaps would help you to understand this Pig specific concept.

Regards,
Shahab
On Tue, Jul 22, 2014 at 12:07 AM, Ashish Dobhal <[EMAIL PROTECTED]>
wrote:
 
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