jiangxt2 opened a new pull request, #12763: URL: https://github.com/apache/gravitino/pull/12763
### What changes were proposed in this pull request? - Overrides `ClickHouseTableOperations.rename()` so tables with trusted Gravitino cluster metadata use `RENAME TABLE ... ON CLUSTER ...`, while local and unmarked external tables keep the existing local rename behavior. - Reads the old table metadata from `system.tables` with an exact current-database and table-name predicate, and rejects a present but blank cluster marker before executing DDL. - Preserves the existing ClickHouse exception mapping and identifier quoting contract without changing the common JDBC rename path. - Expands the repository ClickHouse cluster fixture from one self-referencing node to three independently addressable nodes. - Adds focused unit coverage, local SQL regression coverage, and a three-node lifecycle test that verifies the initiating query, all-node old/new state, comment metadata preservation, and cleanup after drop. ### Why are the changes needed? Fix: #12761 The common JDBC rename path generates a local `RENAME TABLE old_name TO new_name` statement. For ClickHouse tables created through Gravitino with `ON CLUSTER`, that statement renames only the JDBC connection node and leaves the old name on the other nodes, silently splitting cluster metadata and making later DDL inconsistent. ### Does this PR introduce _any_ user-facing change? Yes. Renaming a Gravitino-created ClickHouse table with trusted cluster metadata now propagates to every configured cluster node. Local tables and unmarked external tables retain local rename behavior. This PR does not add or change catalog-facing APIs or property keys. ### How was this patch tested? - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:spotlessCheck` — passed. - `./gradlew rat` — passed. - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test -PskipITs` — passed with no skipped, failed, or errored tests. - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test --tests "org.apache.gravitino.catalog.clickhouse.integration.test.CatalogClickHouseIT.testAlterAndDropClickhouseTable" -PskipDockerTests=false` — passed with `tests=1 skipped=0 failures=0 errors=0`. - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test --tests "org.apache.gravitino.catalog.clickhouse.integration.test.CatalogClickHouseClusterIT" -PskipDockerTests=false` — passed on three ClickHouse 24.8.14 nodes with `tests=19 skipped=0 failures=0 errors=0`. - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:build -x test` — passed. - `python3 ~/GitHub/bin/gravitino-pr-precheck.py --worktree ~/GitHub/workspace/gravitino-fix-clickhouse-clustered-table-rename` — all checks passed. -- 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]
