You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by James <al...@gmail.com> on 2015/02/26 13:38:26 UTC
graph.mapVertices() function obtain edge triplets with null attribute
My code
```
// Initial the graph, assign a counter to each vertex that contains the
vertex id only
var anfGraph = graph.mapVertices { case (vid, _) =>
val counter = new HyperLogLog(5)
counter.offer(vid)
counter
}
val nullVertex = anfGraph.triplets.filter(edge => edge.srcAttr ==
null).first
// There is an edge whose src attr is null
anfGraph.vertices.filter(_._1 == nullVertex).first
// I could see that the vertex has a not null attribute
// messages = anfGraph.aggregateMessages(msgFun, mergeMessage) // <-
NullPointerException
```
My spark version:1.2.0
Alcaid