pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [pulsar] murong00 commented on a change in pull request #3899: [Issue 3896] [pulsar-io] Fix NPE in ElasticSearchSink
Date Tue, 26 Mar 2019 02:44:56 GMT
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

Mime
View raw message