You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "jonvex (via GitHub)" <gi...@apache.org> on 2023/02/22 14:53:28 UTC

[GitHub] [hudi] jonvex commented on a diff in pull request #8011: [HUDI-5808] Add Support for kaffka ofsets in jsonkafkasource and avrokafkasource

jonvex commented on code in PR #8011:
URL: https://github.com/apache/hudi/pull/8011#discussion_r1114436308


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/AvroConvertor.java:
##########
@@ -101,4 +107,18 @@ public GenericRecord fromProtoMessage(Message message) {
     initSchema();
     return ProtoConversionUtil.convertToAvro(schema, message);
   }
+
+  public GenericRecord withKafkaFieldsAppended(ConsumerRecord consumerRecord) {
+    initSchema();
+    GenericRecord record = (GenericRecord) consumerRecord.value();
+    GenericRecordBuilder recordBuilder = new GenericRecordBuilder(this.schema);

Review Comment:
   It always will when this method is called. I added a comment to say it's a requirement. The only place it is used is inside of an if (this.shouldAddOffsets) block, which means that the schemaprovider is wrapped with the kafka offset post processor.



-- 
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-unsubscribe@hudi.apache.org

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