yihua commented on code in PR #12201:
URL: https://github.com/apache/hudi/pull/12201#discussion_r1828441314
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/payload/ExpressionPayload.scala:
##########
@@ -132,12 +133,10 @@ class ExpressionPayload(@transient record: GenericRecord,
.serialize(resultingRow)
.asInstanceOf[GenericRecord]
- if (targetRecord.isEmpty ||
needUpdatingPersistedRecord(targetRecord.get, resultingAvroRecord, properties))
{
- resultRecordOpt = HOption.of(resultingAvroRecord)
+ resultRecordOpt = if (targetRecord.isEmpty) {
Review Comment:
Should `ExpressionPayload` directly implements `HoodieRecordPayload` instead
of `DefaultHoodieRecordPayload` to avoid confusion?
##########
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 originalPayload = properties.getProperty(PAYLOAD_ORIGINAL_AVRO_PAYLOAD)
Review Comment:
```suggestion
val tablePayloadClass =
properties.getProperty(PAYLOAD_ORIGINAL_AVRO_PAYLOAD)
```
##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/payload/ExpressionPayload.scala:
##########
@@ -314,6 +341,11 @@ object ExpressionPayload {
*/
val PAYLOAD_RECORD_AVRO_SCHEMA = "hoodie.payload.record.schema"
+ /**
+ * Original record payload
+ */
+ val PAYLOAD_ORIGINAL_AVRO_PAYLOAD = "hoodie.payload.original.avro.payload"
Review Comment:
```suggestion
val TABLE_PAYLOAD_CLASS = "hoodie.sql.table.payload.class"
```
--
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]