BartMiki commented on code in PR #12915:
URL: https://github.com/apache/druid/pull/12915#discussion_r952247378


##########
extensions-contrib/kafka-emitter/src/main/java/org/apache/druid/emitter/kafka/KafkaEmitter.java:
##########
@@ -166,14 +169,14 @@ private void sendToKafka(final String topic, 
MemoryBoundLinkedBlockingQueue<Stri
   public void emit(final Event event)
   {
     if (event != null) {
-      ImmutableMap.Builder<String, Object> resultBuilder = 
ImmutableMap.<String, Object>builder().putAll(event.toMap());
-      if (config.getClusterName() != null) {
-        resultBuilder.put("clusterName", config.getClusterName());
-      }
-      Map<String, Object> result = resultBuilder.build();
-
       try {
-        String resultJson = jsonMapper.writeValueAsString(result);
+        EventMap map = event.toMap();
+        if (config.getClusterName() != null) {
+          map.put("clusterName", config.getClusterName());

Review Comment:
   If we return ImmutableMap then we get back to the serialization problem with 
Map and polymorphic types in Jackson. `build` needs to return EventMap in this 
case.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to