[ 
https://issues.apache.org/jira/browse/FLINK-3617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15615505#comment-15615505
 ] 

ASF GitHub Bot commented on FLINK-3617:
---------------------------------------

GitHub user chermenin opened a pull request:

    https://github.com/apache/flink/pull/2723

    [FLINK-3617] Simple fix for OptionSerializer.

    This fix prevent possible NullPointerException at serialization process, 
but after deserialization Option variable will be initialized with None value 
and not null (as was before serialization). This decision was made for 
compatibility between versions. What thoughts about it?
    
    This PR solve 
[FLINK-3617](https://issues.apache.org/jira/browse/FLINK-3617).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chermenin/flink flink-3617

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/2723.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2723
    
----
commit b742af340dbba4c927471d7f09e8d0b486dc6637
Author: Aleksandr Chermenin <[email protected]>
Date:   2016-10-28T13:52:26Z

    [FLINK-3617] Simple fix for OptionSerializer.
    
    This fix prevent possible NullPointerException at serialization process,
    but after deserialization Option variable will be initialized with None
    value and not null (as was before serialization).

----


> NPE from CaseClassSerializer when dealing with null Option field
> ----------------------------------------------------------------
>
>                 Key: FLINK-3617
>                 URL: https://issues.apache.org/jira/browse/FLINK-3617
>             Project: Flink
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0.0
>            Reporter: Jamie Grier
>
> This error occurs when serializing a Scala case class with an field of 
> Option[] type where the value is not Some or None, but null.
> If this is not supported we should have a good error message.
> java.lang.RuntimeException: ConsumerThread threw an exception: null
>       at 
> org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09.run(FlinkKafkaConsumer09.java:336)
>       at 
> org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:78)
>       at 
> org.apache.flink.streaming.runtime.tasks.SourceStreamTask.run(SourceStreamTask.java:56)
>       at 
> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:224)
>       at org.apache.flink.runtime.taskmanager.Task.run(Task.java:559)
>       at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.RuntimeException
>       at 
> org.apache.flink.streaming.runtime.io.RecordWriterOutput.collect(RecordWriterOutput.java:81)
>       at 
> org.apache.flink.streaming.runtime.io.RecordWriterOutput.collect(RecordWriterOutput.java:39)
>       at 
> org.apache.flink.streaming.api.operators.StreamSource$NonTimestampContext.collect(StreamSource.java:158)
>       at 
> org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09$ConsumerThread.run(FlinkKafkaConsumer09.java:473)
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.flink.api.scala.typeutils.CaseClassSerializer.serialize(CaseClassSerializer.scala:100)
>       at 
> org.apache.flink.api.scala.typeutils.CaseClassSerializer.serialize(CaseClassSerializer.scala:30)
>       at 
> org.apache.flink.api.scala.typeutils.CaseClassSerializer.serialize(CaseClassSerializer.scala:100)
>       at 
> org.apache.flink.api.scala.typeutils.CaseClassSerializer.serialize(CaseClassSerializer.scala:30)
>       at 
> org.apache.flink.streaming.runtime.streamrecord.StreamRecordSerializer.serialize(StreamRecordSerializer.java:107)
>       at 
> org.apache.flink.streaming.runtime.streamrecord.StreamRecordSerializer.serialize(StreamRecordSerializer.java:42)
>       at 
> org.apache.flink.runtime.plugable.SerializationDelegate.write(SerializationDelegate.java:56)
>       at 
> org.apache.flink.runtime.io.network.api.serialization.SpanningRecordSerializer.addRecord(SpanningRecordSerializer.java:79)
>       at 
> org.apache.flink.runtime.io.network.api.writer.RecordWriter.emit(RecordWriter.java:84)
>       at 
> org.apache.flink.streaming.runtime.io.StreamRecordWriter.emit(StreamRecordWriter.java:86)
>       at 
> org.apache.flink.streaming.runtime.io.RecordWriterOutput.collect(RecordWriterOutput.java:78)
>       ... 3 more



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to