Skip to content

refactor(meta): separate validation and execution logic in alter logical tables procedure #6478

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

Merged

Conversation

WenyXu
Copy link
Member

@WenyXu WenyXu commented Jul 8, 2025

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#6429

What's changed and what's your intention?

This PR refactors the AlterLogicalTablesProcedure by separating validation and execution concerns into dedicated components.

Changes

  • Add AlterLogicalTableValidator:

    • Validates schema consistency across alter expressions
    • Validates alter operation types (currently supports AddColumns)
    • Validates physical table existence and logical table relationships
    • Performs pre-execution checks
  • New AlterLogicalTablesExecutor:

    • Handles metadata updates for alter operations
    • Manages region request generation and processing
    • Coordinates cache invalidation
    • Encapsulates all execution-related logic

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

@github-actions github-actions bot added size/L docs-not-required This change does not impact docs. labels Jul 8, 2025
@WenyXu WenyXu force-pushed the refactor/logical-alter-table-procedure branch 2 times, most recently from 06b9bec to dabc65d Compare July 8, 2025 09:35
@WenyXu WenyXu marked this pull request as ready for review July 8, 2025 10:55
@WenyXu WenyXu requested review from MichaelScofield and a team as code owners July 8, 2025 10:55
@WenyXu WenyXu requested a review from fengjiachun July 8, 2025 10:55
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.

Rest LGTM

Copy link
Collaborator

@MichaelScofield MichaelScofield left a comment

Choose a reason for hiding this comment

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

x

WenyXu added 2 commits July 9, 2025 06:10
…cal tables procedure

Signed-off-by: WenyXu <wenymedia@gmail.com>
Signed-off-by: WenyXu <wenymedia@gmail.com>
@WenyXu WenyXu force-pushed the refactor/logical-alter-table-procedure branch from e207e7a to 43331e9 Compare July 9, 2025 06:10
@WenyXu WenyXu added this pull request to the merge queue Jul 9, 2025
Merged via the queue into GreptimeTeam:main with commit a858f55 Jul 9, 2025
41 checks passed
@WenyXu WenyXu deleted the refactor/logical-alter-table-procedure branch July 9, 2025 07:14
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. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants