prathit06 commented on code in PR #9459:
URL: https://github.com/apache/hudi/pull/9459#discussion_r1297953678


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/KafkaOffsetGen.java:
##########
@@ -479,4 +479,19 @@ private Map<TopicPartition, Long> 
getGroupOffsets(KafkaConsumer consumer, Set<To
     }
     return fromOffsets;
   }
+
+  /**
+   * get null safe kafka key from kafka key object
+   * @param kafkaKeyObject kafka key object
+   * @return kafka key
+   */
+  public static String getKafkaKey(Object kafkaKeyObject) {
+    String recordKey = null;
+    try {
+      recordKey = kafkaKeyObject.toString();
+    } catch (NullPointerException npe) {

Review Comment:
   Removed getKafkaKey util method from KafkaOffsetGen class & used 
`StringUtils#objToString` instead



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to