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: add ChangeColumnType for AlterKind #3757

Merged
merged 10 commits into from
Apr 24, 2024

Conversation

KKould
Copy link
Collaborator

@KKould KKould commented Apr 20, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#3517

What's changed and what's your intention?

add ChangeColumnType to AlterKind and validate ChangeColumnType, process the meta after ChangeColumnType

Tips: The AlterKind::ChangeColumnType part of mapping greptime-proto will be committed later (after the update of greptime-proto)

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.

@KKould KKould requested review from v0y4g3r, MichaelScofield and a team as code owners April 20, 2024 04:56
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Apr 20, 2024
Copy link

codecov bot commented Apr 20, 2024

Codecov Report

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

Project coverage is 85.25%. Comparing base (4437225) to head (1e3fa5b).
Report is 12 commits behind head on main.

❗ Current head 1e3fa5b differs from pull request most recent head d871718. Consider uploading reports for the commit d871718 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3757      +/-   ##
==========================================
- Coverage   85.51%   85.25%   -0.27%     
==========================================
  Files         946      946              
  Lines      159555   160194     +639     
==========================================
+ Hits       136447   136572     +125     
- Misses      23108    23622     +514     

@evenyag
Copy link
Contributor

evenyag commented Apr 22, 2024

I'll review this today if possible.

src/store-api/src/metadata.rs Outdated Show resolved Hide resolved
src/store-api/src/region_request.rs Outdated Show resolved Hide resolved
src/store-api/src/region_request.rs Show resolved Hide resolved
src/table/src/error.rs Outdated Show resolved Hide resolved
src/table/src/metadata.rs Outdated Show resolved Hide resolved
src/table/src/metadata.rs Outdated Show resolved Hide resolved
src/table/src/metadata.rs Outdated Show resolved Hide resolved
src/store-api/src/region_request.rs Outdated Show resolved Hide resolved
src/store-api/src/region_request.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.

If the purpose of ModifyColumn is solely to alter the column type, then ChangeType would be a more apt name. @evenyag What do you think?

src/store-api/src/region_request.rs Outdated Show resolved Hide resolved
@KKould
Copy link
Collaborator Author

KKould commented Apr 23, 2024

If the purpose of ModifyColumn is solely to alter the column type, then ChangeType would be a more apt name. @evenyag What do you think?

I plan to implement renaming column name after this pr
issue: #996

@killme2008
Copy link
Contributor

If the purpose of ModifyColumn is solely to alter the column type, then ChangeType would be a more apt name. @evenyag What do you think?

I plan to implement renaming column name after this pr issue: #996

I prefer that each AlterKind only performs a single function, in line with the Single Responsibility Principle (SRP: https://en.wikipedia.org/wiki/Single-responsibility_principle). Therefore, I personally recommend using a different AlterKind for renaming columns.

@KKould
Copy link
Collaborator Author

KKould commented Apr 23, 2024

If the purpose of ModifyColumn is solely to alter the column type, then ChangeType would be a more apt name. @evenyag What do you think?

I plan to implement renaming column name after this pr issue: #996

I prefer that each AlterKind only performs a single function, in line with the Single Responsibility Principle (SRP: https://en.wikipedia.org/wiki/Single-responsibility_principle). Therefore, I personally recommend using a different AlterKind for renaming columns.

agree, then I will make changes later

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. Great work! Don't forget to change the PR title too.

@killme2008 killme2008 requested a review from evenyag April 23, 2024 12:50
@KKould KKould changed the title feat: add ModifyColumn for AlterKind feat: add ChangeColumnType for AlterKind Apr 23, 2024
src/store-api/src/metadata.rs Outdated Show resolved Hide resolved
src/store-api/src/metadata.rs Outdated Show resolved Hide resolved
@killme2008 killme2008 requested a review from evenyag April 24, 2024 04:25
@evenyag evenyag added this pull request to the merge queue Apr 24, 2024
Merged via the queue into GreptimeTeam:main with commit b619950 Apr 24, 2024
17 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