Davis-Zhang-Onehouse commented on code in PR #12242:
URL: https://github.com/apache/hudi/pull/12242#discussion_r1844250521


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/payload/ExpressionPayload.scala:
##########
@@ -164,6 +163,34 @@ class ExpressionPayload(@transient record: GenericRecord,
     }
   }
 
+  private def doRecordMerge(incomingRecord: GenericRecord,
+                            existingRecord: IndexedRecord,
+                            schema: Schema,
+                            properties: Properties): HOption[IndexedRecord] = {
+    val tablePayloadClass = 
properties.getProperty(PAYLOAD_ORIGINAL_AVRO_PAYLOAD)

Review Comment:
   I gave it a try and if we directly implement the HoodieRecordPayload, we 
lose the implementation of needUpdatingPersistedRecord.
   
   As a result, we either need to duplicate code / have a larger scope of code 
refactor to let 2 payload class to share needUpdatingPersistedRecord logic, 
which is either code duplication or more refactoring which still not addressing 
the concern mentioned here 
https://github.com/apache/hudi/pull/12242#discussion_r1841230992,
   OR we need to always reflect every matched record which will cause perf 
concerns even for the basic case of OverwriteWithLatestAvroPayload and 
DefaultHoodieRecordPayload as you also commented below



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