AnsweredAssumed Answered

Apache pig - nested block explanation

Question asked by Lokesh on Jul 27, 2017
Latest reply on Jul 28, 2017 by Murshid Chalaev

Hi All,

Below is the script from Pig Latin Reference Manual 2 

I have problem understand one small thing. Requesting help. Copied the script as-is from webpage.


A = LOAD 'data' AS (url:chararray,outline:chararray);  DUMP A; (, (, (, (, (, (,  B = GROUP A BY url;  DUMP B; (,{(,}) (,{(,}) (,{(,,(,}) (,{(,,(,})
X = foreach B {         FA= FILTER A BY outlink == ''; //This i believe is TYPO and should be outline.        PA = FA.outlink; //Same applies. must be FA.outline.         DA = DISTINCT PA;         GENERATE GROUP, COUNT(DA); }  DUMP X; (,1L) (,1L)
FA= FILTER A BY outlink == ''; This filter operation in nested block is where i have confusion.
Does this filter operation get each tuple from inner bag for each record in relation B?
I am finding it difficult to understand how the data flow happens between operations.