danny0405 commented on code in PR #20544:
URL: https://github.com/apache/hudi/pull/20544#discussion_r4533153359
##########
hudi-common/src/main/java/org/apache/hudi/common/avro/AvroRecordContext.java:
##########
@@ -203,6 +241,18 @@ public UnaryOperator<IndexedRecord>
projectRecord(HoodieSchema from, HoodieSchem
return record -> HoodieAvroUtils.rewriteRecordWithNewSchema(record,
to.toAvroSchema(), renamedColumns);
}
+ /**
+ * Initializes schema-aware conversion so delete values use the same logical
types as data records.
+ */
+ public void initOrderingValueConverter(HoodieSchema dataSchema, List<String>
orderingFieldNames) {
+ orderingValueConverter = AvroOrderingValueConverter.create(dataSchema,
orderingFieldNames, consistentLogicalTimestampEnabled);
+ }
+
+ @Override
+ public Comparable convertOrderingValueToEngineType(Comparable value) {
+ return orderingValueConverter == null ?
super.convertOrderingValueToEngineType(value) :
orderingValueConverter.convert(value);
Review Comment:
why call `super.convertOrderingValueToEngineType(value)`, it will returns
null anyway?
--
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]