-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Handle missing values in aggregate derivative queries better #4292
Conversation
If an aggregate derivative query did not have a value in the first time bucket, it would abort early and return a single row with value of 0. Similarly, if either the current or previous value was nil, it would skip the row and not append any values causing gaps and no data to show up. Instead, this will append a nil value if either the current or previous valis is nil. This essentially allows nil values to carry through the results as well as gives a more sensible value for rows where we cannot compute a difference (instead of dropping the row as before). Fixes #4237 #4263
@@ -1044,22 +1053,6 @@ func ProcessAggregateDerivative(results [][]interface{}, isNonNegative bool, int | |||
} | |||
} | |||
|
|||
// Check the value's type to ensure it's an numeric, if not, return a 0 result. We only check the first value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this was wrong, it simply should have been done in the loop for every value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is part of it. The current code has the side effect of returning early if the first values nil too.
1 question, but generally looks sensible to me. +1 |
Handle missing values in aggregate derivative queries better
If an aggregate derivative query did not have a value in the first
time bucket, it would abort early and return a single row with a value
of 0. Similarly, if either the current or previous value was nil,
it would skip the row and not append any values causing gaps and
no data to show up.
Instead, this will append a nil value if either the current or previous
value is nil. This essentially allows nil values to carry through the
results as well as gives a more sensible value for rows where we cannot
compute a difference (instead of dropping the row as before).
Fixes #4237 #4263