Function mz_storage::upsert::types::snapshot_merge_function
source ยท pub(crate) fn snapshot_merge_function<O>(
_key: UpsertKey,
updates: impl Iterator<Item = StateValue<O>>,
) -> StateValue<O>where
O: Default,
Expand description
A function that merges a set of updates for a key into the existing value for the key, expected to only be used during the snapshotting-phase of an upsert operator. This is called by the backend implementation when it has accumulated a set of updates for a key, and needs to merge them into the existing value for the key.
The function is called with the following arguments:
- The key for which the merge is being performed.
- An iterator over any current value and merge operands queued for the key. The function should return the new value for the key after merging all the updates.