2

I am new to Apache Flink and Gelly and I use the Scala API. I hava a DataSet of vertices and a DataSet of edges and I am trying to create a graph like this:

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)

And I get the following errors:

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
Fabian Hueske
  • 18,707
  • 2
  • 44
  • 49
Al Jenssen
  • 655
  • 3
  • 9
  • 25

1 Answers1

2

It looks as if you imported Graph from Gelly's Java API. Try to import the Scala version of Graph using import org.apache.flink.graph.scala.Graph. This should fix your problem.

Till Rohrmann
  • 13,148
  • 1
  • 25
  • 51
  • It says that there is not such package. If it helps at all I have imported maven dependencies of gelly like this: org.apache.flink flink-gelly 0.10.1 And my import of graph is import org.apache.flink.graph.{Graph, Vertex, Edge} – Al Jenssen Feb 03 '16 at 20:47
  • 1
    It appears that I had the wrong maven dependency for gelly. The correct one is org.apache.flink flink-gelly-scala 0.10.1 – Al Jenssen Feb 04 '16 at 09:04