lokesh-lingarajan-0310 commented on code in PR #9913:
URL: https://github.com/apache/hudi/pull/9913#discussion_r1370473939


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/streamer/StreamSync.java:
##########
@@ -297,13 +304,17 @@ public StreamSync(HoodieStreamer.Config cfg, SparkSession 
sparkSession, SchemaPr
       this.errorTableWriter = ErrorTableUtils.getErrorTableWriter(cfg, 
sparkSession, props, hoodieSparkContext, fs);
       this.errorWriteFailureStrategy = 
ErrorTableUtils.getErrorWriteFailureStrategy(props);
     }
-    this.formatAdapter = new SourceFormatAdapter(
-        UtilHelpers.createSource(cfg.sourceClassName, props, 
hoodieSparkContext.jsc(), sparkSession, schemaProvider, metrics),
-        this.errorTableWriter, Option.of(props));
+    Source source = UtilHelpers.createSource(cfg.sourceClassName, props, 
hoodieSparkContext.jsc(), sparkSession, schemaProvider, metrics);
+    this.formatAdapter = new SourceFormatAdapter(source, 
this.errorTableWriter, Option.of(props));
 
     this.transformer = 
UtilHelpers.createTransformer(Option.ofNullable(cfg.transformerClassNames),
         
Option.ofNullable(schemaProvider).map(SchemaProvider::getSourceSchema), 
this.errorTableWriter.isPresent());
-
+    if (this.cfg.operation == WriteOperationType.BULK_INSERT && 
source.getSourceType() != Source.SourceType.AVRO) {

Review Comment:
   @nsivabalan had recommended to set the record merger config upon only if 
record merger is not currently set. We can add this to the above if condition
   
    /* Insert Spark record merger only in default bulk insert case for Row type 
source */
       String recordMergerImplsConfig = 
props.getProperty(RECORD_MERGER_IMPLS.key());
       if ((recordMergerImplsConfig == null || 
recordMergerImplsConfig.isEmpty())
           && this.cfg.operation == WriteOperationType.BULK_INSERT
           && source.getSourceType() == Source.SourceType.ROW) {
         this.props.setProperty(RECORD_MERGER_IMPLS.key(), 
HoodieSparkRecordMerger.class.getName());



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