Skip to content

Commit

Permalink
Merge pull request #193 from Qrlew/190-make-sure-each-$varepsilon-1$-…
Browse files Browse the repository at this point in the history
…for-gaussian-mechanism-guarantee-to-be-valid

190 make sure each $varepsilon 1$ for gaussian mechanism guarantee to be valid
  • Loading branch information
ngrislain authored Nov 20, 2023
2 parents 9b0ea7c + 0c33d54 commit c1c9c0a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
"sqlite",
],
"editor.codeActionsOnSave": {},
"rust-analyzer.cargo.buildScripts.overrideCommand": null,
}
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
## Added
- `CAST` function [MR188](https://github.com/Qrlew/qrlew/pull/188)

## [0.5.1] - 2023-11-19
## Added
- Added `Count(*)` by parsing it as `Count(1)`
- Added `Count(*)` by parsing it as `Count(1)` [#185](https://github.com/Qrlew/qrlew/issues/185)
- `CAST` function [MR188](https://github.com/Qrlew/qrlew/pull/188)

### Changed
- Add a warning when the textbook gaussian mechanism is not really applied [#190](https://github.com/Qrlew/qrlew/issues/190)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Nicolas Grislain <ng@sarus.tech>"]
name = "qrlew"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
description = "Sarus Qrlew Engine"
documentation = "https://docs.rs/qrlew"
Expand Down
5 changes: 1 addition & 4 deletions src/differential_privacy/aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ impl PUPRelation {
(input_builder, named_sums, output_builder) = named_aggregates.into_iter().fold(
(input_builder, named_sums, output_builder),
|(mut input_b, mut sums, mut output_b), (name, aggregate)| {
let one_col = "_ONE_".to_string();
let col_name = aggregate.column_name().unwrap().to_string();
let one_col = format!("_ONE_{}", col_name);
let sum_col = format!("_SUM_{}", col_name);
let count_col = format!("_COUNT_{}", col_name);
match aggregate.aggregate() {
Expand Down Expand Up @@ -188,7 +188,6 @@ impl PUPRelation {

let input: Relation = input_builder.input(self.deref().clone()).build();
let pup_input = PUPRelation::try_from(input)?;

let (dp_relation, private_query) = pup_input
.differentially_private_sums(
named_sums
Expand All @@ -200,10 +199,8 @@ impl PUPRelation {
delta,
)?
.into();

let names: HashMap<String, String> =
named_sums.into_iter().map(|(s1, s2)| (s2, s1)).collect();

let dp_relation = output_builder
.input(
dp_relation
Expand Down
2 changes: 1 addition & 1 deletion src/rewriting/rewriting_rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ mod tests {
}
let query = parse(
"SELECT order_id, sum(price) AS sum_price,
count(price) AS count_price,
count(*) AS count_price,
avg(price) AS mean_price
FROM item_table WHERE order_id IN (1,2,3,4,5,6,7,8,9,10) GROUP BY order_id",
)
Expand Down

0 comments on commit c1c9c0a

Please sign in to comment.