-
Notifications
You must be signed in to change notification settings - Fork 332
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: support add if not exists in the gRPC alter kind #5273
Conversation
* checks in make_region_alter_kind() * reuse the alter kind
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5273 +/- ##
==========================================
- Coverage 83.93% 83.86% -0.07%
==========================================
Files 1203 1199 -4
Lines 224144 224559 +415
==========================================
+ Hits 188125 188331 +206
- Misses 36019 36228 +209 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Do we need to change the documentation of ALTER TABLE
statements?
This PR doesn't change the behavior so we don't have to update it. |
…5273) * test: test adding existing columns * chore: add more checks to AlterKind * chore: update logs * fix: check and build table info first * feat: Add add_if_not_exists flag to alter expr * feat: skip existing columns when building alter kind * checks in make_region_alter_kind() * reuse the alter kind * test: fix tests in common-meta * chore: fix typos * chore: update comments
…5273) * test: test adding existing columns * chore: add more checks to AlterKind * chore: update logs * fix: check and build table info first * feat: Add add_if_not_exists flag to alter expr * feat: skip existing columns when building alter kind * checks in make_region_alter_kind() * reuse the alter kind * test: fix tests in common-meta * chore: fix typos * chore: update comments
* test: test adding existing columns * chore: add more checks to AlterKind * chore: update logs * fix: check and build table info first * feat: Add add_if_not_exists flag to alter expr * feat: skip existing columns when building alter kind * checks in make_region_alter_kind() * reuse the alter kind * test: fix tests in common-meta * chore: fix typos * chore: update comments
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
add_if_not_exists
toAddColumn
greptime-proto#207What's changed and what's your intention?
This PR adds the
add_if_not_exists
flag to the AddColumn alter kind and validates the alteration to the table in the prepare step of the AlterTableProcedure. Before this PR, the procedure may not be able to build table info in the update metadata step, which causes regions to have an inconsistent schema with the meta server.It also fixes an issue that the procedure always alters tables without
add_if_not_exists
which is different from the behavior of auto alteration.PR Checklist
Please convert it to a draft if some of the following conditions are not met.