You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "jiangxt2 (via GitHub)" <gi...@apache.org> on 2026/06/25 14:32:37 UTC

[I] [Bug] ClickHouse catalog: ALTER TABLE missing ON CLUSTER for clustered tables [gravitino]

jiangxt2 opened a new issue, #11803:
URL: https://github.com/apache/gravitino/issues/11803

   ### What would you like to be improved?
   
   `ClickHouseTableOperations.generateAlterTableSql()` (line 821-823) generates `ALTER TABLE %s \n%s;` without `ON CLUSTER` clause. For tables created `ON CLUSTER`, this causes schema divergence — the ALTER only affects the local node.
   
   In contrast, `generateDropTableSql()` (line 687-699) correctly reads cluster info from properties and generates `DROP TABLE ... ON CLUSTER ... SYNC`.
   
   **Reproduction steps:**
   
   1. Create a table on cluster:
      ```sql
      CREATE TABLE test ON CLUSTER 'cluster' (id Int64, val String) ENGINE = MergeTree() ORDER BY id;
      ```
   2. Execute `ALTER TABLE test ADD COLUMN new_col Int64` (without ON CLUSTER)
   3. Check all nodes: `new_col` exists on the local node only, other nodes don't have it
   
   Verified on a local ClickHouse cluster: one node added `new_col`, the other nodes did not have it.
   
   ### How should we improve?
   
   Follow the same pattern as `generateDropTableSql()`:
   - Read `ClusterConstants.CLUSTER_NAME` from `lazyLoadTable.properties()`
   - If present, inject `ON CLUSTER <clusterName>` into the ALTER TABLE SQL template
   
   Location: `ClickHouseTableOperations.java`, `generateAlterTableSql()` method, line 822.
   


-- 
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: commits-unsubscribe@gravitino.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] ClickHouse catalog: ALTER TABLE missing ON CLUSTER for clustered tables [gravitino]

Posted by "jiangxt2 (via GitHub)" <gi...@apache.org>.
jiangxt2 commented on issue #11803:
URL: https://github.com/apache/gravitino/issues/11803#issuecomment-4800468646

   I'd like to work on this. I've reproduced the schema divergence on a local ClickHouse cluster and the fix follows the existing pattern in generateDropTableSql(). Could you please assign this to me?


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] ClickHouse catalog: ALTER TABLE missing ON CLUSTER for clustered tables [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 closed issue #11803: [Bug] ClickHouse catalog: ALTER TABLE missing ON CLUSTER for clustered tables
URL: https://github.com/apache/gravitino/issues/11803


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org