yihua commented on code in PR #12452:
URL: https://github.com/apache/hudi/pull/12452#discussion_r1926512752
##########
hudi-common/src/main/java/org/apache/hudi/common/engine/HoodieReaderContext.java:
##########
@@ -226,26 +227,22 @@ public String getRecordKey(T record, Schema schema) {
* @param metadataMap A map containing the record metadata.
* @param schema The Avro schema of the record.
* @param orderingFieldName name of the ordering field
- * @param orderingFieldTypeOpt type of the ordering field
- * @param orderingFieldDefault default value for ordering
* @return The ordering value.
*/
public Comparable getOrderingValue(Option<T> recordOption,
Map<String, Object> metadataMap,
Schema schema,
- String orderingFieldName,
- Option<Schema.Type> orderingFieldTypeOpt,
- Comparable orderingFieldDefault) {
+ Option<String> orderingFieldName) {
if (metadataMap.containsKey(INTERNAL_META_ORDERING_FIELD)) {
return (Comparable) metadataMap.get(INTERNAL_META_ORDERING_FIELD);
}
- if (!recordOption.isPresent() || !orderingFieldTypeOpt.isPresent()) {
- return orderingFieldDefault;
+ if (!recordOption.isPresent() || orderingFieldName.isEmpty()) {
Review Comment:
Only if the record is a delete record, `recordOption` is empty. If that's
the case, and the ordering field is not set, we should use commit time ordering
for such deletes. If the delete record comes with an ordering value, the
`metadataMap` contains the ordering value already, i.e., processed by
```
if (metadataMap.containsKey(INTERNAL_META_ORDERING_FIELD)) {
return (Comparable) metadataMap.get(INTERNAL_META_ORDERING_FIELD);
}
```
--
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]