Skip to main content

insert_partitions_replacing

Function insert_partitions_replacing 

Source
pub fn insert_partitions_replacing(
    lake: &DataLakeConnection,
    view_meta: &ViewMetadata,
    unit_range: TimeRange,
    partitions: &[Partition],
    logger: Arc<dyn Logger>,
) -> impl Future<Output = Result<(), Error>>
Expand description

Replaces every partition of view_meta contained in unit_range by partitions, in one transaction: readers see either the old rows or all of the new ones, never a gap. The partitions must tile a sub-range of unit_range and have been written by write_file without being registered.

On any failure every file of partitions that no row references is deleted, as insert_partition does for its single file; a PartitionOverlapConflict rolls the whole transaction back.