I am using spark-shell for running my code. In my code, I have defined a function and I call that function with its parameters.
The problem is that I get the below error when I call the function.
error: type mismatch;
found : org.apache.spark.graphx.Graph[VertexProperty(in class $iwC)(in class $iwC)(in class $iwC)(in class $iwC),String]
required: org.apache.spark.graphx.Graph[VertexProperty(in class $iwC)(in class $iwC)(in class $iwC)(in class $iwC),String]
What is the reason behind this error? Has it got anything to do with Graph datatype in Spark?
Code : This is the part of my code which involves the definition and call of the function "countpermissions".
class VertexProperty(val id:Long) extends Serializable
case class User(val userId:Long, val userCode:String, val Name:String, val Surname:String) extends VertexProperty(userId)
case class Entitlement(val entitlementId:Long, val name:String) extends VertexProperty(entitlementId)
def countpermissions(es:String, sg:Graph[VertexProperty,String]):Long = {
return 0
}
val triplets = graph.triplets
val temp = triplets.map(t => t.attr)
val distinct_edge_string = temp.distinct
var bcast_graph = sc.broadcast(graph)
val edge_string_subgraph = distinct_edge_string.map(es => es -> bcast_graph.value.subgraph(epred = t => t.attr == es))
val temp1 = edge_string_subgraph.map(t => t._1 -> countpermissions(t._1, t._2))
The code runs without errors until the last line, where it gets the above mentioned error.