alexeykudinkin commented on code in PR #6476:
URL: https://github.com/apache/hudi/pull/6476#discussion_r971358810
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java:
##########
@@ -399,9 +453,65 @@ protected void writeIncomingRecords() throws IOException {
}
}
+ protected SerializableRecord createCDCRecord(HoodieCDCOperation operation,
String recordKey, String partitionPath,
+ GenericRecord oldRecord,
GenericRecord newRecord) {
+ GenericData.Record record;
+ if
(cdcSupplementalLoggingMode.equals(HoodieTableConfig.CDC_SUPPLEMENTAL_LOGGING_MODE_WITH_BEFORE_AFTER))
{
+ record = HoodieCDCUtils.cdcRecord(operation.getValue(), instantTime,
+ oldRecord, addCommitMetadata(newRecord, recordKey, partitionPath));
+ } else if
(cdcSupplementalLoggingMode.equals(HoodieTableConfig.CDC_SUPPLEMENTAL_LOGGING_MODE_WITH_BEFORE))
{
+ record = HoodieCDCUtils.cdcRecord(operation.getValue(), recordKey,
oldRecord);
+ } else {
+ record = HoodieCDCUtils.cdcRecord(operation.getValue(), recordKey);
+ }
+ return new SerializableRecord(record);
+ }
+
+ protected GenericRecord addCommitMetadata(GenericRecord record, String
recordKey, String partitionPath) {
Review Comment:
Meta fields carry purely semantical information related to their
_persistence_ by Hudi.
These aren't the part of the record's payload and we shouldn't be carrying
them w/in CDC payload.
--
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]