Skip to main content

write_batches

Function write_batches 

Source
pub async fn write_batches(
    table: DeltaTable,
    batches: Vec<RecordBatch>,
    writer_id: &str,
    epoch: u64,
    save_mode: SaveMode,
    partition_columns: Option<&[String]>,
    schema_evolution: bool,
) -> Result<(DeltaTable, i64), ConnectorError>
Expand description

Writes batches to a Delta Lake table with exactly-once semantics.

§Arguments

  • table - The Delta Lake table handle (consumed and returned)
  • batches - Record batches to write
  • writer_id - Unique writer identifier for exactly-once deduplication
  • epoch - The epoch number for this write (stored in txn metadata)
  • save_mode - Delta Lake save mode (Append, Overwrite, etc.)
  • partition_columns - Optional partition column name slice
  • schema_evolution - If true, auto-merge new columns into the table schema

§Returns

A tuple of (updated table handle, new Delta version).

§Errors

Returns ConnectorError::WriteError if the write fails.