我是Apache Flink和Gelly的新手,我使用Scala API。我有一个顶点数据集和一个边数据集,我正在尝试创建一个这样的图表:
val env = ExecutionEnvironment.getExecutionEnvironment
// correct result
val edges: DataSet[Edge[Long, Long]] = (some transformations here)
//also correct result
val vertices: DataSet[Vertex[Long, String]] = (some transformations here)
//in the line below I get the errors
val graph = Graph.fromDataSet(vertices, edges, env)
我收到以下错误:
Type mismatch,expected:
DataSet[Vertex[NotInferedK,NotInferedVV]], actual: DataSet[Vertex[Long,String]]
Type mismatch,expected:
DataSet[Edges[NotInferedK,NotInferedEV]], actual: DataSet[Edge[Long,Long]]
Type mismatch,expected:
org.apache.flink.api.java.ExecutionEnvironment, actual: org.apache.flink.api.scala.ExecutionEnvironment
看起来好像你从Gelly的Java API导入了Graph
。尝试使用 import org.apache.flink.graph.scala.Graph
导入 Scala 版本的 Graph
。这应该可以解决您的问题。