I am new in scala and spark-graphx. I write this method to update the scores of the different neighbors of a vertex.
def updateNeighborScores(triplet: EdgeTriplet[(VertexId,(Int,Float,Float,Float,String)),Float]):Float={
graph.mapVertices((id,attr)=> {
if(id==triplet.dstId)
{
val newScore=triplet.attr + triplet.srcAttr._2
(attr._1,newScore,attr._3,attr._2,"InList")
}
else
(attr._1,attr._2,attr._3,attr._4,attr._5)
})
I get the following error after compilation:
> Error:(25, 39) overloaded method value + with alternatives: (x:
> Double)Double <and> (x: Float)Float <and> (x: Long)Float <and>
> (x: Int)Float <and> (x: Char)Float <and> (x: Short)Float <and>
> (x: Byte)Float <and> (x: String)String cannot be applied to ((Int,
> Float, Float, Float, String))
> val newScore=triplet.attr + triplet.srcAttr._2
Any ideas? Many thanks