That is confusing and that is something that William Dowling explained an
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
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
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.
On Tue, Jul 22, 2014 at 12:07 AM, Ashish Dobhal <[EMAIL PROTECTED]>