Sumit6307 opened a new pull request, #8007: URL: https://github.com/apache/incubator-seata/pull/8007
- [x] I have read the [CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md) guidelines. - [x] I have registered the PR [changes](https://github.com/apache/incubator-seata/tree/2.x/changes). ### Ⅰ. Describe what this PR did This PR introduces native AT Mode support for ClickHouse. Because ClickHouse handles data mutations asynchronously and uses different syntax compared to standard relational databases, new executors were built specifically for its SQL dialect. **Key Changes:** 1. **[ClickhouseTableMetaCache](cci:2://file:///c:/Users/Sumit/OneDrive/Desktop/GSOC-2026/gsoc_incubator-seata/gsoc_incubator-seata-2/rm-datasource/src/main/java/org/apache/seata/rm/datasource/sql/struct/cache/ClickhouseTableMetaCache.java:40:0-178:1)**: Designed to properly extract table metadata using ClickHouse's system tables (`system.columns` equivalent via JDBC). 2. **[ClickhouseUndoInsertExecutor](cci:2://file:///c:/Users/Sumit/OneDrive/Desktop/GSOC-2026/gsoc_incubator-seata/gsoc_incubator-seata-2/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/clickhouse/ClickhouseUndoInsertExecutor.java:38:0-91:1)**: Implements the `ALTER TABLE ... DELETE WHERE ...` syntax to rollback inserted records. 3. **[ClickhouseUndoUpdateExecutor](cci:2://file:///c:/Users/Sumit/OneDrive/Desktop/GSOC-2026/gsoc_incubator-seata/gsoc_incubator-seata-2/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/clickhouse/ClickhouseUndoUpdateExecutor.java:36:0-86:1)**: Implements the `ALTER TABLE ... UPDATE ... WHERE ...` syntax for undoing updates. 4. **[ClickhouseUndoDeleteExecutor](cci:2://file:///c:/Users/Sumit/OneDrive/Desktop/GSOC-2026/gsoc_incubator-seata/gsoc_incubator-seata-2/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/clickhouse/ClickhouseUndoDeleteExecutor.java:36:0-85:1)**: Restores deleted records via standard `INSERT INTO`. 5. **[ClickhouseUndoLogManager](cci:2://file:///c:/Users/Sumit/OneDrive/Desktop/GSOC-2026/gsoc_incubator-seata/gsoc_incubator-seata-2/rm-datasource/src/main/java/org/apache/seata/rm/datasource/undo/clickhouse/ClickhouseUndoLogManager.java:30:0-57:1)**: Customized the batch deletion of stale undo logs to prevent syntax errors related to standard SQL `DELETE FROM`. 6. Registered the ClickHouse Executor Holders and Meta Caches via **Java SPI**. ### Ⅱ. Does this pull request fix one issue? <!-- If that, add "fixes #xxx" below in the next line, for example, fixes #97. --> This operates as a Proof-of-Concept for a formal Google Summer of Code (GSoC) 2026 contribution. ### Ⅲ. Why don't you add test cases (unit test/integration test)? N/A - Unit tests have been added. Added the following JUnit mock tests to verify exact SQL generation strings: - [ClickhouseUndoInsertExecutorTest](cci:2://file:///c:/Users/Sumit/OneDrive/Desktop/GSOC-2026/gsoc_incubator-seata/gsoc_incubator-seata-2/rm-datasource/src/test/java/org/apache/seata/rm/datasource/undo/clickhouse/ClickhouseUndoInsertExecutorTest.java:35:0-68:1) - [ClickhouseUndoUpdateExecutorTest](cci:2://file:///c:/Users/Sumit/OneDrive/Desktop/GSOC-2026/gsoc_incubator-seata/gsoc_incubator-seata-2/rm-datasource/src/test/java/org/apache/seata/rm/datasource/undo/clickhouse/ClickhouseUndoUpdateExecutorTest.java:35:0-68:1) - [ClickhouseUndoDeleteExecutorTest](cci:2://file:///c:/Users/Sumit/OneDrive/Desktop/GSOC-2026/gsoc_incubator-seata/gsoc_incubator-seata-2/rm-datasource/src/test/java/org/apache/seata/rm/datasource/undo/clickhouse/ClickhouseUndoDeleteExecutorTest.java:35:0-68:1) ### Ⅳ. Describe how to verify it You can verify the SQL generation through the test suite: ```bash ./mvnw clean test -pl rm-datasource -Dtest=ClickhouseUndo* -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
