Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> computing avg in pig


Copy link to this message
-
computing avg in pig
> I have data in format

>
>
>     1,1.2
>
>     2,1.3
>
>     and so on..
>
>
>
> So basically this is id, val combination where id is unique...
>
>
>
> I want to calculate the average of all the values..
>
>
>
>     So here.. avg(1.2,1.3)
>
>
>
> I was going thru the documentation but most of the aggregation function
involves grouping by some id.. and then using AVG... but since the id is
unique.. how do I group them???
>
> So basically the outcome of this endeavor would be one float..
>
> Any suggestions will be greatly appreciated.
>
> Thanks
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB