Class PartialUpsertHandler
- java.lang.Object
-
- org.apache.pinot.segment.local.upsert.PartialUpsertHandler
-
public class PartialUpsertHandler extends Object
Handler for partial-upsert.
-
-
Constructor Summary
Constructors Constructor Description PartialUpsertHandler(Schema schema, Map<String,UpsertConfig.Strategy> partialUpsertStrategies, UpsertConfig.Strategy defaultPartialUpsertStrategy, String comparisonColumn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericRowmerge(GenericRow previousRecord, GenericRow newRecord)Merges 2 records and returns the merged record.
-
-
-
Constructor Detail
-
PartialUpsertHandler
public PartialUpsertHandler(Schema schema, Map<String,UpsertConfig.Strategy> partialUpsertStrategies, UpsertConfig.Strategy defaultPartialUpsertStrategy, String comparisonColumn)
-
-
Method Detail
-
merge
public GenericRow merge(GenericRow previousRecord, GenericRow newRecord)
Merges 2 records and returns the merged record. We used a map to indicate all configured fields for partial upsert. For these fields (1) If the prev value is null, return the new value (2) If the prev record is not null, the new value is null, return the prev value. (3) If neither values are not null, then merge the value and return. For un-configured fields, they are using default override behavior, regardless null values. For example, overwrite merger will only override the prev value if the new value is not null. Null values will override existing values if not configured. They can be ignored by using ignoreMerger.- Parameters:
previousRecord- the last derived full record during ingestion.newRecord- the new consumed record.- Returns:
- a new row after merge
-
-