flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anirudh Mallem <anirudh.mal...@247-inc.com>
Subject Re: Serializing NULLs
Date Tue, 20 Dec 2016 19:26:01 GMT
If you are using Avro generated classes then you cannot have your values null.

From: Stephan Ewen
Reply-To: "user@flink.apache.org<mailto:user@flink.apache.org>"
Date: Tuesday, December 20, 2016 at 8:17 AM
To: "user@flink.apache.org<mailto:user@flink.apache.org>"
Subject: Re: Serializing NULLs

Thanks for sharing the stack trace.

This seems not really Flink related, it is part of the specific Avro encoding logic.
The Avro Generic Record Type apparently does not allow the map value to be null.

On Tue, Dec 20, 2016 at 4:55 PM, Matt <dromitlabs@gmail.com<mailto:dromitlabs@gmail.com>>
Here is the back trace: https://gist.github.com/56af4818bcf5dee6b97c248fd9233c67

In the meanwhile I've solved the issue by creating a POJO class where null is just Long.MIN_VALUE,
that with a custom equals() made the trick. I guess it's not as fast as de/serializing Double

If you need any other information let me know.


On Tue, Dec 20, 2016 at 6:46 AM, Stephan Ewen <sewen@apache.org<mailto:sewen@apache.org>>
The "null" support in some types is not fully developed. However in that case I am wondering
why it does not work. Can you share the stack trace, so we can take a look at the serializer?

On Mon, Dec 19, 2016 at 9:56 PM, Matt <dromitlabs@gmail.com<mailto:dromitlabs@gmail.com>>
Hello list,

I'm getting this error:

java.lang.RuntimeException: Could not forward element to next operator
Caused by: java.lang.NullPointerException: in com.entities.Sector in map in double null of
double of map in field properties of com.entities.Sector
Caused by: java.lang.NullPointerException

The field mentioned is a HashMap<String, Double>, and some keys are mapped to null values.

Why isn't it possible to forward/serialize those elements with null values?
What do you do when your elements may contain nulls?


View raw message