You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/03/26 02:44:56 UTC

[GitHub] [pulsar] murong00 commented on a change in pull request #3899: [Issue 3896] [pulsar-io] Fix NPE in ElasticSearchSink

murong00 commented on a change in pull request #3899: [Issue 3896] [pulsar-io] Fix NPE in ElasticSearchSink
URL: https://github.com/apache/pulsar/pull/3899#discussion_r268925312
 
 

 ##########
 File path: pulsar-io/elastic-search/src/main/java/org/apache/pulsar/io/elasticsearch/ElasticSearchSink.java
 ##########
 @@ -100,7 +100,7 @@ public void write(Record<byte[]> record) {
     }
 
     public KeyValue<String, byte[]> extractKeyValue(Record<byte[]> record) {
-        String key = record.getKey().orElseGet(null);
+        String key = record.getKey().orElseGet(() -> new String(record.getValue()));
 
 Review comment:
   Changed.

----------------------------------------------------------------
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