-
Notifications
You must be signed in to change notification settings - Fork 411
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
Make fast scan code mode clean #6058
Make fast scan code mode clean #6058
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/cc @breezewish |
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.
Some minor suggestions. This PR is a nice step towards better readability. Good job!
/// We call getInputStreamFast when we read in fast mode. | ||
/// In this case, we will read all the data in delta and stable, and then merge them without sorting. | ||
/// Besides, we will do del_mark != 0 filtering to drop the deleted rows. | ||
/// In conclusion, the output is unsorted, and does not do mvcc filtering. |
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 a very nice explanation!
Co-authored-by: Wenxuan <[email protected]>
Co-authored-by: Wenxuan <[email protected]>
@@ -100,14 +100,35 @@ BlockInputStreamPtr SegmentReadTaskPool::buildInputStream(SegmentReadTaskPtr & t | |||
MemoryTrackerSetter setter(true, mem_tracker.get()); | |||
auto seg = t->segment; | |||
BlockInputStreamPtr stream; | |||
if (is_raw) | |||
auto block_size = std::max(expected_block_size, static_cast<size_t>(dm_context->db_context.getSettingsRef().dt_segment_stable_pack_rows)); |
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.
Code in dbms/src/Storages/DeltaMerge/SegmentReadTaskPool.cpp L103-L131 is similar to dbms/src/Storages/DeltaMerge/DMSegmentThreadInputStream.h L103-L131.
Maybe we can do some refactoring and make code reusable.
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, I try to make a new function for L103-L131 to make code reusable, please take a look.
/run-all-tests |
break; | ||
} | ||
LOG_FMT_DEBUG(log, "getInputStream succ, pool_id={} segment_id={}", pool_id, seg->segmentId()); | ||
buildStreamBasedOnReadMode(stream, read_mode, t, dm_context, columns_to_read, filter, max_version, expected_block_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.
How about this?
- getInputStream(Mode, ...)
- getInputStreamModeNormal(...)
- getInputStreamModeFast(...)
- getInputStreamModeRaw(...)
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.
Good suggestion! I think getInputStream(Mode, ...) in class Segment is a better way to make the code reuseable and clean.
/run-all-tests |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
/merge |
@hongyunyan: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. 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. |
This pull request has been accepted and is ready to merge. Commit hash: 0320e01
|
@hongyunyan: 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. |
/run-unit-test |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
Coverage for changed files
Coverage summary
full coverage report (for internal network access only) |
What problem does this PR solve?
Issue Number: ref #5252
Problem Summary:
What is changed and how it works?
Seperate the read process in
selraw *
and the read process in fast scan, to make the code more understandable.Check List
Tests
Side effects
Documentation
Release note