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: Defines more structs and methods for a partitioned merge tree #3348

Merged
merged 8 commits into from Feb 21, 2024

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Feb 21, 2024

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR defines more methods and structs related to Partition and Shard for the merge tree.

  • The Partition provides two methods write_with_key() and write_no_key() to write a row with or without a primary key
  • We can scan the partition by the scan() method
  • We can also freeze or fork a partition
  • Shard also has similar methods
  • We use the value of __table_id column as partition key
  • The merge tree finds a partition according to the partition key to a row
  • The merge tree will try to prune partitions by filters to reduce the number of partitions to scan
  • Implements freeze(), fork() for the merge tree

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

Refer to a related PR or issue link (optional)

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Feb 21, 2024
@evenyag evenyag marked this pull request as ready for review February 21, 2024 09:55
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: 260 lines in your changes are missing coverage. Please review.

Comparison is base (f087a84) 85.24% compared to head (51c57d2) 84.72%.
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3348      +/-   ##
==========================================
- Coverage   85.24%   84.72%   -0.52%     
==========================================
  Files         882      887       +5     
  Lines      144085   144657     +572     
==========================================
- Hits       122823   122563     -260     
- Misses      21262    22094     +832     

Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@v0y4g3r v0y4g3r left a comment

Choose a reason for hiding this comment

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

LGTM

@v0y4g3r v0y4g3r merged commit 7c88d72 into GreptimeTeam:main Feb 21, 2024
16 checks passed
@v0y4g3r v0y4g3r deleted the feat/merge-tree-part branch February 21, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants