-
Notifications
You must be signed in to change notification settings - Fork 409
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
Storage: Refactor DMFileReader #8927
Storage: Refactor DMFileReader #8927
Conversation
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Could you elaborate the bug in this issue |
done |
Actually, |
updated |
/hold |
/unhold |
00a6838
to
8972ec8
Compare
dbms/src/Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp
Outdated
Show resolved
Hide resolved
dbms/src/Storages/DeltaMerge/tests/gtest_dm_delta_merge_store.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: jinhelin <linjinhe33@gmail.com>
Block block = read(); | ||
size_t rows = block.rows(); | ||
|
||
IColumn::Filter block_filter(filter.cbegin() + read_rows, filter.cbegin() + read_rows + block.rows()); | ||
read_rows += block.rows(); | ||
|
||
if (size_t passed_count = countBytesInFilter(block_filter); passed_count != block.rows()) | ||
if (size_t passed_count = countBytesInFilter(filter, offset, rows); passed_count != rows) | ||
{ | ||
for (auto & col : block) | ||
std::vector<size_t> positions; | ||
positions.reserve(passed_count); | ||
for (size_t p = offset; p < offset + rows; ++p) | ||
{ | ||
col.column = col.column->filter(block_filter, passed_count); | ||
if (filter[p]) | ||
positions.push_back(p - offset); | ||
} | ||
for (size_t i = 0; i < block.columns(); ++i) | ||
{ | ||
columns[i]->insertDisjunctFrom(*block.getByPosition(i).column, positions); | ||
} | ||
} | ||
|
||
blocks.emplace_back(std::move(block)); | ||
else | ||
{ | ||
for (size_t i = 0; i < block.columns(); ++i) | ||
{ | ||
columns[i]->insertRangeFrom( | ||
*block.getByPosition(i).column, | ||
0, | ||
block.getByPosition(i).column->size()); | ||
} | ||
} |
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.
We assume readWithFilter
will never be called on the three hidden columns, so we don't need to take care about whether the block.getByPosition(i).column
is ColumnConst or not?
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.
for (size_t i = 0; i < block.columns(); ++i) | ||
{ | ||
columns[i]->insertRangeFrom( | ||
*block.getByPosition(i).column, | ||
0, | ||
block.getByPosition(i).column->size()); | ||
} |
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.
Are there any cases cover this branch?
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.
It is kind of hard to construct.... #8927 (comment) never do clean read here, so the source and target column are must be the same.
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JaySon-Huang, JinheLin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
@Lloyd-Pottiger: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests
If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #8904
Problem Summary:
In the previous implementation, I used
insertManyFrom
to insert data in ConstColumn into the target column.tiflash/dbms/src/Columns/ColumnVector.h
Lines 216 to 220 in adc57e2
In
insertManyFrom
, ColumnVector::insertManyFrom only expected calling src with exactly the same type of Self rather than any subclass of IColumn. If we do so, static_cast<const Self &>(src).getData() just returns a random memory location. It causes the del tag column contains too much non-zero value, leading to return less data than expected.What is changed and how it works?
insertMany
inIColumn
Add insertMany interface for IColumn #8925insertMany
instead ofinsertManyFrom
Check List
Tests
Side effects
Documentation
Release note