flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabian Hueske <fhue...@gmail.com>
Subject Re: Join two Datasets --> InvalidProgramException
Date Tue, 09 Feb 2016 11:07:11 GMT
What is the type of sessionId?
It must be a key type in order to be used as key. If it is a generic class,
it must implement Comparable to be used as key.

2016-02-09 11:53 GMT+01:00 Dominique Rondé <dominique.ronde@codecentric.de>:

> The fields in SourceA and SourceB are private but have public getters and
> setters. The classes provide an empty and public constructor.
> Am 09.02.2016 11:47 schrieb "Chiwan Park" <chiwanpark@apache.org>:
>
>> Oh, the fields in SourceA have public getters. Does the fields in SourceA
>> have public setter? SourceA needs public setter for private fields.
>>
>> Regards,
>> Chiwan Park
>>
>> > On Feb 9, 2016, at 7:45 PM, Chiwan Park <chiwanpark@apache.org> wrote:
>> >
>> > Hi Dominique,
>> >
>> > It seems that `SourceA` is not dealt as POJO. Are all fields in SourceA
>> public? There are some requirements for POJO classes [1].
>> >
>> > [1]:
>> https://ci.apache.org/projects/flink/flink-docs-release-0.10/apis/programming_guide.html#pojos
>> >
>> > Regards,
>> > Chiwan Park
>> >
>> >> On Feb 9, 2016, at 7:42 PM, Dominique Rondé <
>> dominique.ronde@codecentric.de> wrote:
>> >>
>> >> Hi  folks,
>> >>
>> >> i try to join two datasets containing some PoJos. Each PoJo inherit a
>> field "sessionId" from the parent class. The field is private but has a
>> public getter.
>> >>
>> >> The join is like this:
>> >> DataSet<Tuple2<SourceA,SourceB>> joinedDataSet =
>> sourceA.join(SourceB).where("sessionId").equalTo("sessionId");
>> >>
>> >> But the result is the following execption:
>> >>
>> >> Exception in thread "main"
>> org.apache.flink.api.common.InvalidProgramException: This type
>> (GenericType<x.y.z.service.eventstore.dto.SourceA>) cannot be used as key.
>> >>    at
>> org.apache.flink.api.java.operators.Keys$ExpressionKeys.<init>(Keys.java:287)
>> >>    at
>> org.apache.flink.api.java.operators.JoinOperator$JoinOperatorSets.where(JoinOperator.java:890)
>> >>    at
>> x.y.z.eventstore.processing.pmc.PmcProcessor.main(PmcProcessor.java:55)
>> >>
>> >> I spend some time with google around but I don't get an idea what is
>> wrong. I hope some of you can give me a hint...
>> >>
>> >> Greets
>> >> Dominique
>> >>
>> >
>>
>>

Mime
View raw message