Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def computeContribs(tuples : RDD[(Int,List[Int])], ranks : RDD[(Int, Double)] ) : RDD[(Int, Double)] = {
- val x = tuples.map{case(numpage,list)=>(numpage,(list,1.0/list.size))}
- val joined = x.join(ranks)
- val contribs = joined.flatMap{case(numPage,(pageList,size), rank) => pageList.map( y:Int=>(y,size) )}
- contribs.reduceByKey(_+_)
- }
- /*
- [error] C:\Users\vital\Documents\spazi_lavoro\spark-examples\src\main\scala\pagerank\PageRankSpark.scala:11: constructor cannot be instantiated to expected type;
- [error] found : (T1, T2, T3)
- [error] required: (Int, ((List[Int], Double), Double))
- [error] val contribs = joined.flatMap{case(numPage,(pageList,size), rank) => pageList.map( y:Int=>(y,size) )}
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement