我是Apache Flink和Gelly的新手,我使用的是Scala API。我有一个顶点的DataSet和一个边的DataSet,我试图创建一个这样的图:
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
答案 0 :(得分:2)
看起来好像是从Gelly的Java API导入Graph
。尝试使用Graph
导入import org.apache.flink.graph.scala.Graph
的Scala版本。这应该可以解决你的问题。