Skip to content

Commit

Permalink
feat: implementation for replaceWhere (#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)
#1957

# Documentation
Added a section in docs

---------

Signed-off-by: Nikolay Ulmasov <[email protected]>
Co-authored-by: Ion Koutsouris <[email protected]>
  • Loading branch information
r3stl355 and ion-elgreco authored Jan 31, 2024
1 parent 467afc5 commit b107407
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
Loading

0 comments on commit b107407

Please sign in to comment.