1

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
4

0 回答 0