Aircloak / aircloak

This repository contains the Aircloak Air frontend as well as the code for our Cloak query and anonymization platform
2 stars 0 forks source link

Allow pure column math in implicit ranges #3481

Open sebastian opened 5 years ago

sebastian commented 5 years ago

In a separate issue @yoid2000 comments that:

... First, I don't see a problem with allowing math with implicit ranges as long as constants are not involved. And in the case of bucket, the x of by x does not have to be counted as a constant since it is snapped. The precision constants of round and trunc also ok since they are implicitly snapped.

What should we allow? The math restrictions we have in place are in large part present because we want to prevent the construction of a boolean logic by use of arbitrary math. Then I believe it was limited further for some other reason.

What does the above statement concrete mean we could allow?

We'd have to think a bit about how to seed.

Assuming the above is fine, we would need to discuss the seeds too.

yoid2000 commented 5 years ago

Currently we disallow using math with implicit functions. So for instance round(col/3) is disallowed.

What I'm saying generally is that we can allow math as long as constants are not used. So we could do round(col1/col2). The rule that any expression with two or more math operations is treated as a constant would still apply.

yoid2000 commented 5 years ago

As another example, for the synthetic data project, I made a nateive database view where datetime is converted to epoch (since cloak doesn't support that), and then wanted to do:

select bucket(dropoff_datetime - pickup_datetime by 100)
from syn_rides

but not allowed. This issue would allow that.