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: Implements a reader to make schema compatible #2326

Conversation

evenyag
Copy link
Contributor

@evenyag evenyag commented Sep 5, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

This PR implements a CompatReader to make readers from SSTs with an old schema to be compatible with the latest schema.

  • To make primary keys compatible, CompatPrimaryKey encodes new tags and appends encoded data to the old primary key.
  • To make fields compatible, CompatFields builds a mapping from old fields to new fields. For missing columns, it adds a default vector.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

@evenyag evenyag marked this pull request as ready for review September 6, 2023 03:02
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

❗ No coverage uploaded for pull request base (migrate-region-server@90a809b). Click here to learn what that means.
The diff coverage is n/a.

Additional details and impacted files
@@                   Coverage Diff                    @@
##             migrate-region-server    #2326   +/-   ##
========================================================
  Coverage                         ?   77.79%           
========================================================
  Files                            ?      712           
  Lines                            ?   113969           
  Branches                         ?        0           
========================================================
  Hits                             ?    88662           
  Misses                           ?    25307           
  Partials                         ?        0           

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

@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
Copy link
Contributor

@evenyag Some conflicts have to be resolved.

@evenyag evenyag requested a review from v0y4g3r September 7, 2023 02:37
@MichaelScofield MichaelScofield added this pull request to the merge queue Sep 7, 2023
Merged via the queue into GreptimeTeam:migrate-region-server with commit a3d1bb7 Sep 7, 2023
11 checks passed
waynexia pushed a commit that referenced this pull request Sep 12, 2023
* docs: update comment

* feat: Add compat reader to SeqScan

* feat: add struct to compat pk and fields

* refactor: remove unused fields from ParquetReader

* feat: compat framework

* feat: Implement CompatPrimaryKey and CompatFields

* feat: implement compat reader

* feat: Test compat reader

* test: test compat reader

* feat: add more checks to concat

* style: fix clippy

* test: more tests for compat reader

* test: test reader with projection
waynexia pushed a commit that referenced this pull request Sep 12, 2023
* docs: update comment

* feat: Add compat reader to SeqScan

* feat: add struct to compat pk and fields

* refactor: remove unused fields from ParquetReader

* feat: compat framework

* feat: Implement CompatPrimaryKey and CompatFields

* feat: implement compat reader

* feat: Test compat reader

* test: test compat reader

* feat: add more checks to concat

* style: fix clippy

* test: more tests for compat reader

* test: test reader with projection
waynexia pushed a commit that referenced this pull request Sep 12, 2023
* docs: update comment

* feat: Add compat reader to SeqScan

* feat: add struct to compat pk and fields

* refactor: remove unused fields from ParquetReader

* feat: compat framework

* feat: Implement CompatPrimaryKey and CompatFields

* feat: implement compat reader

* feat: Test compat reader

* test: test compat reader

* feat: add more checks to concat

* style: fix clippy

* test: more tests for compat reader

* test: test reader with projection
WenyXu pushed a commit to WenyXu/greptimedb that referenced this pull request Sep 13, 2023
* docs: update comment

* feat: Add compat reader to SeqScan

* feat: add struct to compat pk and fields

* refactor: remove unused fields from ParquetReader

* feat: compat framework

* feat: Implement CompatPrimaryKey and CompatFields

* feat: implement compat reader

* feat: Test compat reader

* test: test compat reader

* feat: add more checks to concat

* style: fix clippy

* test: more tests for compat reader

* test: test reader with projection
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* docs: update comment

* feat: Add compat reader to SeqScan

* feat: add struct to compat pk and fields

* refactor: remove unused fields from ParquetReader

* feat: compat framework

* feat: Implement CompatPrimaryKey and CompatFields

* feat: implement compat reader

* feat: Test compat reader

* test: test compat reader

* feat: add more checks to concat

* style: fix clippy

* test: more tests for compat reader

* test: test reader with projection
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.

4 participants