-
Notifications
You must be signed in to change notification settings - Fork 6.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 order of ranges in MergeTreeDataSelectExecutor #9050
Conversation
@@ -251,6 +240,10 @@ void MergeTreeReadPool::fillPerThreadInfo( | |||
{ | |||
threads_tasks.resize(threads); | |||
|
|||
/// Let the ranges be listed from right to left so that the leftmost range can be dropped using `pop_back()`. |
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.
If the only reason to reverse the array is to have O(1) deletion, we can just use std::deque
.
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, we can. Actually I don't know why originally std::vector was used.
237c667
to
8527723
Compare
Fix mistake introduced in #9050.
Fix order of ranges in MergeTreeDataSelectExecutor (cherry picked from commit 5b4b04e)
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix order of ranges while reading from
MergeTree
table in one thread. It could lead to exceptions fromMergeTreeRangeReader
or wrong query results.Fixes #8964.