技术解析
JOIN_SHOW_CLK = join SHOW by (query,wid,csid) LEFT,CLK by (query,wid,csid);
tmp = foreach JOIN_SHOW_CLK GENERATE (CLK::csid is null? 0:1) as cs;
Grpd = group tmp by cs;
Smmd = foreach Grpd generate group, COUNT(tmp) as number,1,1,1;
Srtd = order Smmd by number desc;
dump Srtd;
SHOW_CLK = foreach JOIN_SHOW_CLK generate
SHOW::openid..SHOW::t2_csid,
(CLK::csid is null? 0:1) as is_clk;
Grpd = group SHOW_CLK by is_clk;
Smmd = foreach Grpd generate group, COUNT(SHOW_CLK) as number,1,1,1;
Srtd = order Smmd by number desc;
dump Srtd;
RT,我是想分组统计 CLK::csid 的数量,讲道理两个的输出结果应该是一样的啊,可是输出却不一样,请问是为什么呢?