Skip to main content

merge_changelog

Function merge_changelog 

Source
pub async fn merge_changelog(
    table: DeltaTable,
    source_batch: RecordBatch,
    key_columns: &[String],
    writer_id: &str,
    epoch: u64,
    schema_evolution: bool,
) -> Result<(DeltaTable, MergeResult), ConnectorError>
Expand description

Atomic changelog MERGE: inserts, updates, and deletes in one Delta commit.

The source batch must contain an _op column (Utf8) with values:

  • "I", "U", "r" → upsert (update if matched, insert if not)
  • "D" → delete matched rows

Columns prefixed with _ are excluded from SET clauses but remain in the source DataFrame for predicate filtering.

§Errors

Returns ConnectorError::WriteError if the merge fails.