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


##########
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:
   And the util method should not put here because the key has no relationship 
with kafka offset.



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