Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

190 make sure each $varepsilon 1$ for gaussian mechanism guarantee to be valid #193

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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