Skip to content

Commit

Permalink
Merge pull request #272 from Qrlew/full_outer_join_afteragg
Browse files Browse the repository at this point in the history
remove coalsce of PU and change to LEFT JOIN after clipping
  • Loading branch information
andicuko authored Mar 15, 2024
2 parents 1445a71 + 8097f07 commit 0d95e82
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Changed
- removing the coalesce of the privacy unit with since it looses the UNIQUE property and changing the JOIN to left instead of INNER after the clipping.

## [0.9.14] - 2024-01-30
### Added
Expand Down
7 changes: 2 additions & 5 deletions src/differential_privacy/aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,11 @@ impl PupRelation {
let mut input_builder = Map::builder()
.with((
self.privacy_unit(),
Expr::coalesce(
Expr::cast_as_text(Expr::col(self.privacy_unit())),
Expr::val(self.privacy_unit_default().to_string()),
),
Expr::col(self.privacy_unit())
))
.with((
self.privacy_unit_weight(),
Expr::coalesce(Expr::col(self.privacy_unit_weight()), Expr::val(0.)),
Expr::col(self.privacy_unit_weight())
));

let mut group_by_names = vec![];
Expand Down
2 changes: 1 addition & 1 deletion src/relation/rewriting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ impl Relation {
pub fn scale(self, entities: &str, named_values: &[(&str, &str)], scale_factors: Relation) -> Self {
// Join the two relations on the entity column
let join: Relation = Relation::join()
.inner(Expr::val(true))
.left_outer(Expr::val(true))
.on_eq(entities, entities)
.left_names(
self.fields()
Expand Down

0 comments on commit 0d95e82

Please sign in to comment.