-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Fix behaviour of quantileDeterministic function #25313
Conversation
setSkipDegree(skip_degree + 1); | ||
|
||
/// Still good? |
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.
This is the fix.
In previous version, the value is not being filtered after coarsening, so one excessive value can appear in the final reservoir.
@@ -59,9 +59,10 @@ template <typename T, | |||
ReservoirSamplerDeterministicOnEmpty OnEmpty = ReservoirSamplerDeterministicOnEmpty::THROW> | |||
class ReservoirSamplerDeterministic | |||
{ | |||
bool good(const UInt32 hash) | |||
private: |
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.
This is old code (circa 2014), it also contains hairy decisions and mistakes. E.g. total_values
is calculated and serialized but not used.
This is fine. |
Backport #25313 to 21.6: Fix behaviour of quantileDeterministic function
Backport #25313 to 21.3: Fix behaviour of quantileDeterministic function
Backport #25313 to 21.5: Fix behaviour of quantileDeterministic function
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix the possibility of non-deterministic behaviour of the
quantileDeterministic
function and similar. This closes #20480.