public class FirstValueAvroPayload extends DefaultHoodieRecordPayload
Simplified FirstValueAvroPayload Logic:
Illustration with simple data.
the order field is 'ts', recordkey is 'id' and schema is :
{
[
{"name":"id","type":"string"},
{"name":"ts","type":"long"},
{"name":"name","type":"string"},
{"name":"price","type":"string"}
]
}
case 1
Current data:
id ts name price
1 1 name_1 price_1
Insert data:
id ts name price
1 1 name_2 price_2
Result data after #preCombine or #combineAndGetUpdateValue:
id ts name price
1 1 name_1 price_1
If precombine is the same, would keep the first one record
case 2
Current data:
id ts name price
1 1 name_1 price_1
Insert data:
id ts name price
1 2 name_2 price_2
Result data after preCombine or combineAndGetUpdateValue:
id ts name price
1 2 name_2 price_2
The other functionalities are inherited from DefaultHoodieRecordPayload.
DELETE_KEY, DELETE_MARKER, METADATA_EVENT_TIME_KEYisDeletedRecord, orderingVal, recordBytes| Constructor and Description |
|---|
FirstValueAvroPayload(org.apache.avro.generic.GenericRecord record,
Comparable orderingVal) |
FirstValueAvroPayload(Option<org.apache.avro.generic.GenericRecord> record) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
needUpdatingPersistedRecord(org.apache.avro.generic.IndexedRecord currentValue,
org.apache.avro.generic.IndexedRecord incomingRecord,
Properties properties) |
OverwriteWithLatestAvroPayload |
preCombine(OverwriteWithLatestAvroPayload oldValue)
This method is deprecated.
|
combineAndGetUpdateValue, getInsertValue, getMetadata, isDeleted, isDeleteRecordcombineAndGetUpdateValue, getInsertValue, getOrderingValue, overwriteFieldcanProduceSentinel, getOrderingVal, isDeleteRecordclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpreCombine, preCombinepublic FirstValueAvroPayload(org.apache.avro.generic.GenericRecord record,
Comparable orderingVal)
public FirstValueAvroPayload(Option<org.apache.avro.generic.GenericRecord> record)
public OverwriteWithLatestAvroPayload preCombine(OverwriteWithLatestAvroPayload oldValue)
HoodieRecordPayloadHoodieRecordPayload.preCombine(HoodieRecordPayload, Properties) method.preCombine in interface HoodieRecordPayload<OverwriteWithLatestAvroPayload>preCombine in class OverwriteWithLatestAvroPayloadprotected boolean needUpdatingPersistedRecord(org.apache.avro.generic.IndexedRecord currentValue,
org.apache.avro.generic.IndexedRecord incomingRecord,
Properties properties)
needUpdatingPersistedRecord in class DefaultHoodieRecordPayloadCopyright © 2024 The Apache Software Foundation. All rights reserved.