-
Notifications
You must be signed in to change notification settings - Fork 306
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
binary ops with a subset of group by keys #1244
Conversation
This change add support for binary operations where both sides are grouped and the keys for one side is a subset of the other. Before the keys would have to match exactly. When one side has a subset, the matching for entries will be performed using the smaller set of keys. For example, suppose that dimensions `a` and `b` each have two values: ``` Expr: q1,(,a,b,),:by, q2,(,a,),:by, :add Result Set: q1:a1b1 + q2:a1 q1:a1b2 + q2:a1 q1:a2b1 + q2:a2 q1:a2b2 + q2:a2 ```
Exact match sounds reasonable, sub set match result can be confusing for users, what kind use cases benefit from this? |
An example use-case is computing the percentage of different types of failures for a set of clusters. The numerator is the number of failures by cluster and status. To get a percentage relative to a given cluster, the lines for a given cluster need to be divided by the total number of requests for that cluster.
I'm not sure it creates more confusion. I have had some power users kind of assume it would work in the past and were surprised it did not. However, there is a bit of selection bias there, so may not generalize well to users that are less familiar with Atlas. We already support it where one side is grouped and the other isn't:
This change makes it a bit more regular as that can be thought of as one side having an empty set for the grouping keys. We are no longer special casing that one example of a subset. |
In the past this wasn't permitted because binary operations had to have the same grouping on both sides. In Netflix#1244 that was changed so that one side could have a subset of the other.
In the past this wasn't permitted because binary operations had to have the same grouping on both sides. In Netflix#1244 that was changed so that one side could have a subset of the other.
In the past this wasn't permitted because binary operations had to have the same grouping on both sides. In #1244 that was changed so that one side could have a subset of the other.
In the past this wasn't permitted because binary operations had to have the same grouping on both sides. In Netflix#1244 that was changed so that one side could have a subset of the other.
This change add support for binary operations where both
sides are grouped and the keys for one side is a subset
of the other. Before the keys would have to match exactly.
When one side has a subset, the matching for entries will
be performed using the smaller set of keys.
For example, suppose that dimensions
a
andb
each havetwo values: