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: distinguish between different read paths #3369

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

v0y4g3r
Copy link
Contributor

@v0y4g3r v0y4g3r commented Feb 23, 2024

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR handles different read/freeze paths of DataBuffer in different components πŸ˜΅β€πŸ’«

  • For DataBuffer::read inside ShardBuilder

    • pk_weights must be present, yielded rows are sorted according to weights
    • replace_pk_index set to false as pk dict are not frozen yet
    • keep_data set to true
  • For DataBuffer::freeze inside ShardBuilder

    • pk_weights must be present, yielded rows are sorted according to weights
    • replace_pk_index set to true so that yielded DataPart contains only weights
    • keep_data set to false as we need to take the values
  • For DataBuffer::read inside Shard

    • pk_weights set to None as DataBuffer in Shard has already replaced pk_index with weights, rows are sorted by "pk_index" directly
    • replace_pk_index set to false for the same reason
    • keep_data set to true
  • For DataBuffer::freeze inside Shard

    • pk_weights set to None as DataBuffer in Shard has already replaced pk_index with weights, rows are sorted by "pk_index" directly
    • replace_pk_index set to false for the same reason
    • keep_data set to false as we need to take the values

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 23, 2024
@v0y4g3r v0y4g3r marked this pull request as ready for review February 23, 2024 10:41
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 96.08939% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 85.16%. Comparing base (b144836) to head (d43ddaf).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3369      +/-   ##
==========================================
- Coverage   85.56%   85.16%   -0.40%     
==========================================
  Files         892      892              
  Lines      146412   146543     +131     
==========================================
- Hits       125282   124810     -472     
- Misses      21130    21733     +603     

Copy link
Contributor

@evenyag evenyag 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
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

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

Believe it's good

@waynexia waynexia added this pull request to the merge queue Feb 23, 2024
Merged via the queue into GreptimeTeam:main with commit 1f1d1b4 Feb 23, 2024
16 checks passed
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.

3 participants