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 的数量,讲道理两个的输出结果应该是一样的啊,可是输出却不一样,请问是为什么呢?
1
AllOfMe 2018-08-24 22:04:14 +08:00
no data, no result , who 可以 answer 这个问题?
|
2
DongDongXie OP @AllOfMe 我的意思是单从语法上分析,我感觉是不应该出现前后两次统计结果不一致的情况,可他还是发生了,所以很不解
|
3
cm5168 2018-08-25 06:55:01 +08:00
cs 和 is_clk 不一样,group 出来的数据也不一样吧,第一个是根据一个数据 group,第二个是根据三个数据 group
|