Skip to content

Conversation

@WenyXu
Copy link
Member

@WenyXu WenyXu commented Jan 8, 2026

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#6558

What's changed and what's your intention?

as title

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/M docs-not-required This change does not impact docs. labels Jan 8, 2026
@WenyXu WenyXu force-pushed the feat/repartition-sql branch from 1bdbc75 to 516a516 Compare January 8, 2026 04:17
@WenyXu WenyXu changed the title feat(repartition): implement validation logic for repartition_table feat(repartition): implement validation logic for repartition table Jan 8, 2026
@WenyXu WenyXu marked this pull request as ready for review January 8, 2026 07:53
@WenyXu WenyXu requested a review from a team as a code owner January 8, 2026 07:53
@WenyXu WenyXu requested review from fengjiachun and waynexia January 8, 2026 07:53
Signed-off-by: WenyXu <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements validation logic for table repartition operations (REPARTITION, SPLIT PARTITION, and MERGE PARTITION) in GreptimeDB. While the actual repartition execution is not yet implemented (returns "Not supported" error), the PR adds comprehensive validation that will be used when the feature is fully integrated.

Key changes:

  • Added validation logic to check partition expressions before repartitioning
  • Implemented checks for logical vs physical tables, partition column constraints, and partition expression validity
  • Added comprehensive error test cases covering various failure scenarios

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/cases/standalone/common/alter/repartition_error.sql Test cases for repartition validation errors including logical table checks, non-partition column usage, non-existent partitions, incomplete rules, and overlapping partitions
tests/cases/standalone/common/alter/repartition_error.result Expected error messages and results for the repartition error test cases
src/table/src/metadata.rs Added partition_columns() helper method to return an iterator over partition column schemas
src/operator/src/statement/ddl.rs Implemented repartition_table() function with validation logic for repartition operations including checks for logical tables, partition column validation, and partition expression validation
src/operator/src/error.rs Added DeserializePartitionExpr error type for handling partition expression deserialization failures

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GreptimeTeam GreptimeTeam deleted a comment from chatgpt-codex-connector bot Jan 8, 2026
@WenyXu WenyXu added this pull request to the merge queue Jan 8, 2026
Merged via the queue into GreptimeTeam:main with commit aadfcd7 Jan 8, 2026
49 checks passed
@WenyXu WenyXu deleted the feat/repartition-sql branch January 8, 2026 12:49
linyihai pushed a commit to linyihai/greptimedb that referenced this pull request Jan 28, 2026
…reptimeTeam#7538)

* feat(repartition): implement validation logic for repartition_table

Signed-off-by: WenyXu <[email protected]>

* refactor: minor refactor

Signed-off-by: WenyXu <[email protected]>

* test: update sqlness

Signed-off-by: WenyXu <[email protected]>

---------

Signed-off-by: WenyXu <[email protected]>
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/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants