-
Notifications
You must be signed in to change notification settings - Fork 968
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
refactor(search_family): Add Aggregator class #4290
base: main
Are you sure you want to change the base?
refactor(search_family): Add Aggregator class #4290
Conversation
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
c55f47c
to
1e30ca5
Compare
Signed-off-by: Stepan Bagritsevich <[email protected]>
return descending; | ||
} | ||
return true; // Elements are equal | ||
}; |
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.
why do we return true if elements are equal for less operator? As I understand you could take previous implementation and return something like "res != descending"
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.
Yes, it makes sense to return . But just to note, we are not guaranteeing any strict ordering in the result when elements are equal. This is because the final order also depends on the initial distribution of keys across shards (results from shards are joined into one vector, and then a sort is performed on this array).descending
here
So, it is not a "stable" sort, meaning that the initial order of the data is influenced by the key distribution across shards, which may give the user the impression of an unstable sort
Upd.: After discussion, it was decided to return false
if the elements are equal.
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
edb9ce4
to
34ea3c7
Compare
I simplified the comparator logic, so I don't think it’s necessary to use |
…ues is not present Signed-off-by: Stepan Bagritsevich <[email protected]>
related to this comment
Aggregator
class.std::string
copies entirely during the aggregation steps.TODO:
std::function