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


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/cdc/CDCFileGroupIterator.scala:
##########
@@ -540,15 +551,24 @@ class CDCFileGroupIterator(split: HoodieCDCFileGroupSplit,
     convertToUTF8String(HoodieCDCUtils.recordToJson(record))
   }
 
-  private def merge(currentRecord: InternalRow, newRecord: InternalRow): 
ImmutablePair[HoodieSparkRecord, Schema] = {
-    recordMerger.merge(new HoodieSparkRecord(currentRecord, structTypeSchema), 
avroSchema,
-      new HoodieSparkRecord(newRecord, structTypeSchema), avroSchema, props)
-      .get().asInstanceOf[ImmutablePair[HoodieSparkRecord, Schema]]
+  private def merge(currentRecord: BufferedRecord[InternalRow], newRecord: 
BufferedRecord[InternalRow]): BufferedRecord[InternalRow] = {
+    if (!isPartialMergeEnabled && keyBasedFileGroupRecordBuffer.isPresent && 
keyBasedFileGroupRecordBuffer.get().isPartialMergingEnabled) {

Review Comment:
   looking at the key based buffer:
   ```
       if (dataBlock.containsPartialUpdates() && !enablePartialMerging) {
         // When a data block contains partial updates, subsequent record 
merging must always use
         // partial merging.
         enablePartialMerging = true;
         bufferedRecordMerger = BufferedRecordMergerFactory.create(
             readerContext,
             recordMergeMode,
             true,
             recordMerger,
             orderingFieldNames,
             payloadClass,
             readerSchema,
             props,
             partialUpdateMode);
       }
   ```
   once you have partial updates, you never disable the flag



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