Skip to content

Commit

Permalink
feat: implementation for replaceWhere (delta-io#1996)
Browse files Browse the repository at this point in the history
# Description
First/naive implementation of `replaceWhere` for `write`. Code compiles
and there is a test to verify the outcome. I would appreciate any
feedback on improving the structure/implementation. For example, I
copied the part of code from `delete` operation because there is no way
to call that code in `delete` directly from `write` - should I look into
extracting that code from `delete` to somewhere central?

Seems to also works with partitions columns.

# Related Issue(s)
delta-io#1957

# Documentation
Added a section in docs

---------

Signed-off-by: Nikolay Ulmasov <ulmasov@hotmail.com>
Co-authored-by: Ion Koutsouris <15728914+ion-elgreco@users.noreply.github.com>
  • Loading branch information
2 people authored and RobinLin666 committed Feb 2, 2024
1 parent fa1d518 commit 2b6e171
Show file tree
Hide file tree
Showing 12 changed files with 578 additions and 45 deletions.
6 changes: 6 additions & 0 deletions crates/core/src/delta_datafusion/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,12 @@ impl DeltaDataChecker {
self
}

/// Add the specified set of constraints to the current DeltaDataChecker's constraints
pub fn with_extra_constraints(mut self, constraints: Vec<Constraint>) -> Self {
self.constraints.extend(constraints);
self
}

/// Create a new DeltaDataChecker
pub fn new(snapshot: &DeltaTableState) -> Self {
let invariants = snapshot.schema().get_invariants().unwrap_or_default();
Expand Down

0 comments on commit 2b6e171

Please sign in to comment.