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,300 points
81 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
• 69,030 points

Related Questions In Big Data Hadoop

+1 vote
2 answers
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
863 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,950 points
6,356 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,950 points
985 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,320 points
1,073 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
35,443 views