flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aljoscha Krettek <aljos...@apache.org>
Subject Re: Simple GraphX example.
Date Wed, 27 Apr 2016 14:13:13 GMT
Hi,
I think you need to import the stuff from org.apache.flink.graph.scala.*
instead of org.apache.flink.graph.*.

Cheers,
Aljoscha

On Wed, 27 Apr 2016 at 16:07 Trevor Grant <trevor.d.grant@gmail.com> wrote:

> Hi, I'm running Flink 1.0.2 from the Zeppelin/shell- trying to experiment
> with some graph stuff.
>
> Zeppelin has been known to add degrees of crazy to trouble shooting- but I
> intuitively feel like this is something I'm doing wrong on the Flink Side.
>
> The simplest example is not working for me.
>
> import org.apache.flink.api.scala._
>
> import org.apache.flink.graph.Edge
> import org.apache.flink.graph.Vertex
> import org.apache.flink.graph.Graph
>
> val vertices = Seq(new Vertex[Long, String](1L, "foo"), new Vertex[Long,
> String](2L, "bar"))
> val edges = Seq(new Edge[Long, String](1L, 2L, "foobar"))
>
> val graph = Graph.fromCollection(edges, vertices)
>
> Yields:
>
> <console>:46: error: type mismatch;
> found : Seq[org.apache.flink.graph.Edge[Long,String]]
> required: java.util.Collection[org.apache.flink.graph.Edge[?,?]]
> val graph = Graph.fromCollection(edges, vertices)
>
>
> I get a similar error when I try to make DataSets,
>
> found :
> org.apache.flink.api.scala.DataSet[org.apache.flink.graph.Edge[Long,Double]]
> required:
> org.apache.flink.api.java.DataSet[org.apache.flink.graph.Edge[?,?]]
> val graph = Graph.fromDataSet( edges, vertices)
>
> Thoughts?
>
> thanks,
> tg
>
> Trevor Grant
> Data Scientist
> https://github.com/rawkintrevo
> http://stackexchange.com/users/3002022/rawkintrevo
> http://trevorgrant.org
>
> *"Fortunate is he, who is able to know the causes of things."  -Virgil*
>
>

Mime
View raw message