Skip to content

Commit

Permalink
update negate explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmcsherry committed Aug 3, 2020
1 parent 140eada commit 78bcd48
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/transform/src/redundant_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,11 @@ impl RedundantJoin {
}

RelationExpr::Negate { input } => {
// Negate changes the sign on its multiplicities,
// which means "distinct" counts would now be -1.
// We set `exact` to false to inhibit the optimization,
// but should probably fix `.keys` instead.
// Negate does not guarantee that the multiplicity of
// each source record it at least one. This could have
// been a problem in `Union`, where we might report
// that the union of positive and negative records is
// "exact": cancelations would make this false.
let mut result = self.action(input, lets);
for prov in result.iter_mut() {
prov.exact = false;
Expand Down

0 comments on commit 78bcd48

Please sign in to comment.