我正在尝试使用 Scala API 在图形上运行连接组件算法,如编程指南和其他示例中所示。
val graph = Graph.fromDataSet(vertices, edges, env).getUndirected
val maxIterations = 10
val components = graph.run(new ConnectedComponents(maxIterations))
我收到以下错误:
Type mismatch, expected: GraphAlgorithm[Long,String,Long,NotInferedT], actual: ConnectedComponents[Nothing,Nothing]
即使我添加
val components = graph.run(new ConnectedComponents[Long,String,Long](maxIterations))
我得到:
Type mismatch, expected: GraphAlgorithm[Long,String,Long,NotInferedT], actual: ConnectedComponents[Long,String]
我的进口是这些:
import org.apache.flink.api.scala._
import org.apache.flink.graph.library.ConnectedComponents
import org.apache.flink.graph.{Vertex, Edge}
import org.apache.flink.graph.scala.Graph
有人可以解释为什么会这样吗?