Skip to content
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

feat: Implement merge reader #225

Merged
merged 12 commits into from
Sep 9, 2022
Merged

feat: Implement merge reader #225

merged 12 commits into from
Sep 9, 2022

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Sep 5, 2022

Changes

This PR implements the MergeReader which supports sort and merge rows from multiple source readers/iterators by the row key, timestamp, sequence and op_type

Related Issues

@evenyag evenyag force-pushed the feat/merge-iter branch 2 times, most recently from 63f536a to d3b425d Compare September 5, 2022 06:57
Now the ChunkReaderImpl use MergeReader as default reader. Also add more tests to MergeReader.
Ports the doc comments from kudu to merge.rs to describe the idea of the
merge algorithm we used.
@evenyag evenyag marked this pull request as ready for review September 7, 2022 07:05
@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #225 (c4d9b04) into develop (7f81958) will increase coverage by 0.34%.
The diff coverage is 96.74%.

@@             Coverage Diff             @@
##           develop     #225      +/-   ##
===========================================
+ Coverage    82.97%   83.32%   +0.34%     
===========================================
  Files          274      275       +1     
  Lines        22099    22580     +481     
===========================================
+ Hits         18336    18814     +478     
- Misses        3763     3766       +3     
Flag Coverage Δ
rust 83.32% <96.74%> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/storage/src/lib.rs 100.00% <ø> (ø)
src/storage/src/error.rs 30.76% <25.00%> (-0.81%) ⬇️
src/storage/src/test_util/read_util.rs 91.89% <83.33%> (-8.11%) ⬇️
src/storage/src/read.rs 92.08% <92.53%> (-0.32%) ⬇️
src/storage/src/read/merge.rs 99.69% <99.69%> (ø)
src/storage/src/chunk.rs 96.20% <100.00%> (-0.39%) ⬇️
src/storage/src/region/tests/flush.rs 100.00% <100.00%> (ø)
src/storage/src/schema.rs 93.60% <100.00%> (+0.26%) ⬆️
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

src/storage/src/read.rs Show resolved Hide resolved
src/storage/src/read.rs Show resolved Hide resolved
src/storage/src/read.rs Show resolved Hide resolved
src/storage/src/read/merge.rs Show resolved Hide resolved
src/storage/src/read/merge.rs Outdated Show resolved Hide resolved
Panics if number of columns in batch is not equal to `BatchBuilder`'s
src/storage/src/error.rs Outdated Show resolved Hide resolved
src/storage/src/read/merge.rs Outdated Show resolved Hide resolved
src/storage/src/read/merge.rs Outdated Show resolved Hide resolved
src/storage/src/read/merge.rs Show resolved Hide resolved
src/storage/src/read/merge.rs Outdated Show resolved Hide resolved
src/storage/src/read/merge.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@killme2008 killme2008 merged commit 82dfe78 into develop Sep 9, 2022
@killme2008 killme2008 deleted the feat/merge-iter branch September 9, 2022 03:35
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* feat: Check columns when constructing Batch

* feat: Merge reader skeleton

* test: Add tests for MergeReader

* feat: Use get_ref to compare row

* feat: Implement MergeReader

* test: Add more tests

* feat: Use MergeReader to implement ChunkReader

Now the ChunkReaderImpl use MergeReader as default reader. Also add more tests to MergeReader.

* docs: Describe the merge algo in merge.rs

Ports the doc comments from kudu to merge.rs to describe the idea of the
merge algorithm we used.

* test: Fix unit tests

* chore: Address CR comments

Panics if number of columns in batch is not equal to `BatchBuilder`'s

* chore: Address CR comments

* chore: Implement Debug and add test for Node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants