我使用subgraph
来过滤图顶点。
但是,当我收集顶点时,会有一些null
值。
我可以保证原始图顶点不包含null
值。
class A ....
val graph = .... // no null value contained
val selected_id:Set[Int] = SomeAlgorithm collect() toSet
val sub = graph.subgraph(vpred = (id,data) => data match {
case x:A => selected_id contains x.id
case _ => true
})
sub.vertices.map(_._2).collect() filter (_ == null) foreach println //null printed out