nsivabalan commented on code in PR #10118:
URL: https://github.com/apache/hudi/pull/10118#discussion_r1399555891


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/AvroKafkaSource.java:
##########
@@ -78,18 +79,25 @@ public AvroKafkaSource(TypedProperties props, 
JavaSparkContext sparkContext, Spa
 
     try {
       props.put(NATIVE_KAFKA_VALUE_DESERIALIZER_PROP, 
Class.forName(deserializerClassName).getName());
-      if 
(deserializerClassName.equals(KafkaAvroSchemaDeserializer.class.getName())) {
-        if (schemaProvider == null) {
-          throw new HoodieReadFromSourceException("SchemaProvider has to be 
set to use KafkaAvroSchemaDeserializer");
-        }
-        props.put(KAFKA_VALUE_DESERIALIZER_SCHEMA.key(), 
schemaProvider.getSourceSchema().toString());
-      }
     } catch (ClassNotFoundException e) {
       String error = "Could not load custom avro kafka deserializer: " + 
deserializerClassName;
       LOG.error(error);
       throw new HoodieReadFromSourceException(error, e);
     }
-    this.offsetGen = new KafkaOffsetGen(props);
+
+    if 
(deserializerClassName.equals(KafkaAvroSchemaDeserializer.class.getName())) {

Review Comment:
   can we move all these to a private method named refreshPropsAndOffsetGen
   ```
   if 
(deserializerClassName.equals(KafkaAvroSchemaDeserializer.class.getName())) {
         configureSchemaDeserializer();
       }
       offsetGen = new KafkaOffsetGen(props);
   ```
   so that we can call here in L88 and in L 96. 
   
   



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

Reply via email to