You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/05/31 08:51:13 UTC

[GitHub] [flink] lamber-ken opened a new pull request #8583: [FLINK-11820][serialization] SimpleStringSchema handle message record which value is null

lamber-ken opened a new pull request #8583: [FLINK-11820][serialization] SimpleStringSchema handle message record which value is null
URL: https://github.com/apache/flink/pull/8583
 
 
   My branch has been deleted unexpectly, so I open this one, for more detail, please see #7987 
   
   ## What is the purpose of the change
   
   when kafka msg queue contains some records which value is null, `SimpleStringSchema` can't process these records.
   
   for example, msg queue like bellow.
   <table class="table table-bordered table-striped table-condensed">
       <tr>
           <td>msg</td>
           <td>null</td>
           <td>msg</td>
           <td>msg</td>
           <td>msg</td>
       </tr>
   </table>
   
    for normal, use **SimpleStringSchema** to process msg queue data
   ```
   env.addSource(new FlinkKafkaConsumer010("topic", new SimpleStringSchema(), properties));
   ```
    but, will get NullPointerException
   
   ```
   java.lang.NullPointerException
   	at java.lang.String.<init>(String.java:515)
   	at org.apache.flink.api.common.serialization.SimpleStringSchema.deserialize(SimpleStringSchema.java:75)
   	at org.apache.flink.api.common.serialization.SimpleStringSchema.deserialize(SimpleStringSchema.java:36)
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services