我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