0
votes

I have relation named ==> total which i get after grouping a file

so if i use this command grunt> describe total;

grunt> **total: {group: int,long}**

file date =>
(851,3)                                                                                                                                              
(1110,6)                                                                                                                                             
(1115,19)                                                                                                                                            
(1758,2)                                                                                                                                             
(,1)

So the problem is i want to calculate the sum of long colum which has to give 31 in the total.

i used this line.

show_total = FOREACH total_flights GENERATE SUM(group);

but it is giving error please guide me to do it right.

2
Post your entire script and sample data.VK_217

2 Answers

0
votes

What is the error you are getting? Also,try this :

show_total = FOREACH total_flights GENERATE SUM(group.columnname);
0
votes
show_total = FOREACH total_flights GENERATE SUM(group.$1) ;

or set the column name and try

show_total = FOREACH total_flights GENERATE SUM(group.columname) ;