2017-01-18 2 views

Antwort

0

Wenn Sie Zeilen mit Nullsummen ausfiltern müssen, verwenden having:

select id, sum(value) from table group by id having sum(value) is not null; 
0

In Mathe Standard 2+0=2 so seine ohnehin über dieses hive .Don't Sorge zur Arbeit gehen wird standardmäßig darauf achten sein wird, diese .

hive> create table first (Id int,value int); 
OK 
Time taken: 3.895 seconds 
hive> select * from first; 
OK 
1  2 
1  NULL 
hive> select id, sum(value) as sum from first group by id; 
Total MapReduce CPU Time Spent: 4 seconds 610 msec 
OK 
1  2 
Time taken: 83.483 seconds, Fetched: 1 row(s)