kssumin opened a new pull request, #36873: URL: https://github.com/apache/shardingsphere/pull/36873
Fixes #10476 ## Changes This PR enables `ALTER TABLE ... RENAME TO` and `RENAME TABLE` statements for sharding and broadcast tables. ### Implementation details * Removed restrictions that previously blocked RENAME operations on sharding/broadcast tables * Added validation to prevent new table names from conflicting with existing sharding tables or schema tables * Added `renameTables()` method to `MetaDataManagerPersistService` interface for metadata management * Implemented rename logic in both `ClusterMetaDataManagerPersistService` and `StandaloneMetaDataManagerPersistService` * Updated `AlterTablePushDownMetaDataRefresher` and `RenameTablePushDownMetaDataRefresher` to handle rename operations * Added comprehensive test coverage with 8 test cases ### Behavior - **Single tables**: Physical rename + automatic rule update - **Sharding/Broadcast tables**: Physical rename works; rules must be updated manually via DistSQL (consistent with DROP TABLE and CREATE TABLE behavior) ### Files changed **Checker Classes (Remove restrictions + Add validation):** - `ShardingAlterTableSupportedChecker.java` - `ShardingRenameTableSupportedChecker.java` - `ShardingAlterTableSupportedCheckerTest.java` - `ShardingRenameTableSupportedCheckerTest.java` **Metadata Management (Add renameTables method):** - `MetaDataManagerPersistService.java` (interface) - `ClusterMetaDataManagerPersistService.java` (implementation) - `StandaloneMetaDataManagerPersistService.java` (implementation) **Metadata Refreshers (Handle RENAME operations):** - `AlterTablePushDownMetaDataRefresher.java` - `RenameTablePushDownMetaDataRefresher.java` Before committing this PR, I'm sure that I have checked the following options: - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project. - [ ] I have self-reviewed the commit code. - [ ] I have (or in comment I request) added corresponding labels for the pull request. - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`. - [ ] I have made corresponding changes to the documentation. - [ ] I have added corresponding unit tests for my changes. - [ ] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
