-
Notifications
You must be signed in to change notification settings - Fork 453
feat(repartition): implement validation logic for repartition table #7538
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
Conversation
Signed-off-by: WenyXu <[email protected]>
1bdbc75 to
516a516
Compare
Signed-off-by: WenyXu <[email protected]>
Signed-off-by: WenyXu <[email protected]>
115ad1a to
502a140
Compare
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.
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.
…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]>
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.