Error in reduceGroup operator when changing the Flink version from 0.7 to 0.8

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error in reduceGroup operator when changing the Flink version from 0.7 to 0.8

Hung
This post was updated on .
Hi, when changing the version from 0.7 to 0.8, reduceGroup operator gets the following error:

"The method reduceGroup(GroupReduceFunction<Tuple,R>) in the type DataSet<Tuple> is not applicable for the arguments (InDegreeDistribution.CountVertices)"

Tried to figure out the error but failed to fix it. Could you please give some suggestions?

The code is as follows:
-------------------------------------------------------------------------------------------------------------
DataSet<Long> numVertices edges.project(1)).distinct().reduceGroup(new CountVertices())

public static class CountVertices implements
                        GroupReduceFunction<Tuple1<Long>, Long> {
                @Override
                public void reduce(Iterable<Tuple1<Long>> vertices,
                                Collector<Long> collector) throws Exception {
                        collector.collect(new Long(Iterables.size(vertices)));
                }
        }

Best regards,

Hung
Reply | Threaded
Open this post in threaded view
|

Re: error in reduceGroup operator when changing the Flink version from 0.7 to 0.8

Stephan Ewen
Hi Hung!

Can you tell us who exactly gives you that error? The java compiler, or Flink, when you run the program?

If it is Flink, can you attach the stack trace of the exception?

Greetings,
Stephan


On Tue, Feb 24, 2015 at 10:50 AM, HungChang <[hidden email]> wrote:
Hi, when changing the version from 0.7 to 0.8, reduceGroup operator gets the
following error:

"The method reduceGroup(GroupReduceFunction<Tuple,R>) in the type
DataSet<Tuple> is not applicable for the arguments
(InDegreeDistribution.CountVertices)"

Tried to figure out the error but failed to fix it. Could you please give
some suggestions?

The code is as follows:
-------------------------------------------------------------------------------------------------------------
DataSet<Long> numVertices edges.project(1)).distinct().reduceGroup(new
CountVertices())

public static class CountVertices implements
                        GroupReduceFunction<Tuple1&lt;Long>, Long> {
                @Override
                public void reduce(Iterable<Tuple1&lt;Long>> vertices,
                                Collector<Long> collector) throws Exception {
                        collector.collect(new Long(Iterables.size(vertices)));
                }
        }

Best regards,

Hung



--
View this message in context: http://apache-flink-incubator-user-mailing-list-archive.2336050.n4.nabble.com/error-in-reduceGroup-operator-when-changing-the-Flink-version-from-0-7-to-0-8-tp785.html
Sent from the Apache Flink (Incubator) User Mailing List archive. mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: error in reduceGroup operator when changing the Flink version from 0.7 to 0.8

Hung
This post was updated on .
Thanks for your reply.

The error is from java compiler (Eclipse).
It looks like the data type of output and input are OK in 0.7 version, but not proper in 0.8 version.

Best regards,

Hung
Reply | Threaded
Open this post in threaded view
|

Re: error in reduceGroup operator when changing the Flink version from 0.7 to 0.8

Aljoscha Krettek
The problem is that someone changed how project() works. Sorry for the
inconvenience. To make it work, you have to add the type parameter
manually, so that the result of project() has the correct type:

DataSet<Long> numVertices
edges.<Tuple1<Long>>project(1)).distinct().reduceGroup(new
CountVertices())

On Tue, Feb 24, 2015 at 11:19 AM, HungChang <[hidden email]> wrote:

> Thanks for your reply.
>
> The error is from java compiler (Eclipse).
> It looks like the data type of output and input are OK in 0.7 version, but
> not proper in 0.8 version.
>
>
>
> --
> View this message in context: http://apache-flink-incubator-user-mailing-list-archive.2336050.n4.nabble.com/Error-in-reduceGroup-operator-when-changing-the-Flink-version-from-0-7-to-0-8-tp785p789.html
> Sent from the Apache Flink (Incubator) User Mailing List archive. mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: error in reduceGroup operator when changing the Flink version from 0.7 to 0.8

Hung
This post was updated on .
Thank you!This is completely solving the problem.