Class PartialUpsertHandler


  • public class PartialUpsertHandler
    extends Object
    Handler for partial-upsert.
    • Method Detail

      • merge

        public void merge​(LazyRow prevRecord,
                          GenericRow newRecord)
        Merges 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:
        prevRecord - wrapper for previous record, which lazily reads column values of previous row and caches for re-reads.
        newRecord - the new consumed record.