在spark的空表test上进行运算,注意结果差异:
select name,sum(if(age is null,0,age)) as ages from test group by name;//空 select sum(if(age is null,0,age)) as ages from test group by name;//空 select sum(if(age is null,0,age)) as ages from test; //null