flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Ewen <se...@apache.org>
Subject Re: Collector and null tuple values
Date Wed, 23 Sep 2015 13:58:19 GMT
In general, Tuples may not have null fields - the  tuples have no handling
for null.

It is just by chance that String actually handles itself with null.
In general the unspecified (but effective) behavior is that if the types
themselves support null handling, then you can use them. But I would not
rely on that feature.

Tuples should be used with non-null elements. I would use an "Option" type
(in Scala) for null elements, or a POJO in Java.


On Wed, Sep 23, 2015 at 3:34 PM, Robert Metzger <rmetzger@apache.org> wrote:

> Are you talking about a Tuple2<String, Boolean> t for example?
> So t.f0 == null doesn't cause any issues, but t.f1 == null is failing?
> What's the error message?
>
> On Wed, Sep 23, 2015 at 3:31 PM, Flavio Pompermaier <pompermaier@okkam.it>
> wrote:
>
>> Hi to all,
>>
>> why it is possible to collect (in a flatMap function for example) a Tuple
>> with a null String but it's not possible with a null Boolean value? Is that
>> normal?
>>
>> Best,
>> Flavio
>>
>
>

Mime
View raw message