ReduceByKey Avereage

0 votes
How can we find average on a key-value pair using reduceByKey transformation?
Jan 21, 2019 in Big Data Hadoop by slayer
• 29,260 points
41 views

1 answer to this question.

0 votes

You can try the code mentioned below to do this:

val f = List(("panda",1),("pink",2),("panda",2),("pink",3))
rdd.mapValues(value=>(value,1))
rdd.collect

image

answered Jan 21, 2019 by Omkar
• 68,860 points

Related Questions In Big Data Hadoop

+1 vote
1 answer
0 votes
1 answer

What do we exactly mean by “Hadoop” – the definition of Hadoop?

The official definition of Apache Hadoop given ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by Shubham
307 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,840 points
3,905 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,840 points
536 views
0 votes
1 answer

reduceByKey or reduceByKeyLocally , which should be preferred ?

Yes, they both merge the values using ...READ MORE

answered Apr 20, 2018 in Apache Spark by kurt_cobain
• 9,290 points
699 views
0 votes
5 answers

groupByKey vs reduceByKey in Apache Spark.

ReduceByKey is the best for production. READ MORE

answered Mar 3, 2019 in Apache Spark by anonymous
15,828 views