grunt> A = LOAD 'c.txt' AS (col1:chararray, col2:int, col3:int, col4:int, col5:double, col6:double, col7:int);
grunt> B = GROUP A BY (col2, col3, col4);
grunt> C = FOREACH B {D = DISTINCT A.col7; GENERATE group, COUNT(D);};
grunt> DUMP C;
把上面内容,添加如下内容
B = GROUP A BY (col2, col3, col4,col7);
C = FOREACH B GENERATE (D = DISTINCT col7; group, COUNT(D));
修改为下面形式
grunt> A = LOAD 'c.txt' AS (col1:chararray, col2:int, col3:int, col4:int, col5:double, col6:double, col7:int);
grunt> B = GROUP A BY (col2, col3, col4,col7);
C = FOREACH B GENERATE (D = DISTINCT col7; group, COUNT(D));
grunt> DUMP C;