[HUDI-2909] Handle logical type in TimestampBasedKeyGenerator (#4203)
* [HUDI-2909] Handle logical type in TimestampBasedKeyGenerator Timestampbased key generator was returning diff values for row writer and non row writer path. this patch fixes it and is guarded by a config flag (`hoodie.datasource.write.keygenerator.consistent.logical.timestamp.enabled`)
This commit is contained in:
@@ -77,7 +77,7 @@ public class PayloadCreation implements Serializable {
|
||||
if (shouldCombine) {
|
||||
ValidationUtils.checkState(preCombineField != null);
|
||||
Comparable<?> orderingVal = (Comparable<?>) HoodieAvroUtils.getNestedFieldVal(record,
|
||||
preCombineField, false);
|
||||
preCombineField, false, false);
|
||||
return (HoodieRecordPayload<?>) constructor.newInstance(record, orderingVal);
|
||||
} else {
|
||||
return (HoodieRecordPayload<?>) this.constructor.newInstance(Option.of(record));
|
||||
|
||||
@@ -94,7 +94,7 @@ public class TestStringToRowDataConverter {
|
||||
(GenericRecord) converter.convert(AvroSchemaConverter.convertToSchema(rowType), rowData);
|
||||
StringToRowDataConverter stringToRowDataConverter =
|
||||
new StringToRowDataConverter(rowType.getChildren().toArray(new LogicalType[0]));
|
||||
final String recordKey = KeyGenUtils.getRecordKey(avroRecord, rowType.getFieldNames());
|
||||
final String recordKey = KeyGenUtils.getRecordKey(avroRecord, rowType.getFieldNames(), false);
|
||||
final String[] recordKeys = KeyGenUtils.extractRecordKeys(recordKey);
|
||||
Object[] convertedKeys = stringToRowDataConverter.convert(recordKeys);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user