Skip to content
Advertisement

Parsing Avro messages in flink , giving null pointer exception if field is nullable in Avro Schema

I need to parse the messages from confluent Kafka stored in Avro. But while applying filter it is giving null pointer exception, without filter i was able to write back into kafka but while applying filter, it is giving null pointer exception.

JavaScript

Here is the Schema:

JavaScript

Advertisement

Answer

When you have null vallue in your topic for col3 and you trying to access it .toString() you have your exception and it’s normal behavior for null.toString().

You should test if col3 is not null

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement