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

   ### Describe the feature
   
   The ClickHouse JDBC catalog exposes table-level MergeTree settings as table 
properties with the `settings.` prefix and preserves them through CREATE and 
load operations, but ALTER currently rejects both `TableChange.SetProperty` and 
`TableChange.RemoveProperty`. Add support for modifying and resetting these 
existing table properties without recreating the table.
   
   ### Motivation
   
   ClickHouse operators commonly adjust table settings such as 
`merge_with_ttl_timeout` after table creation. The current catalog can read and 
create these settings but cannot alter them, leaving an asymmetric lifecycle 
and forcing users to bypass Gravitino or recreate tables.
   
   ### Describe the solution
   
   - Map `SetProperty("settings.<name>", <scalar-literal>)` to `ALTER TABLE ... 
MODIFY SETTING <name> = <scalar-literal>`.
   - Map `RemoveProperty("settings.<name>")` to `ALTER TABLE ... RESET SETTING 
<name>`.
   - Keep engine, cluster metadata, distributed-table properties, and every 
other non-`settings.*` property immutable through this path.
   - Accept settings-only requests containing either set operations or remove 
operations. Reject requests that mix set and remove operations, or settings 
with schema, comment, or index changes, before opening a JDBC connection.
   - Validate setting names and scalar literal syntax locally, but let 
ClickHouse remain authoritative for read-only, unknown, range, and permission 
errors. Do not maintain a client-side mutable-setting whitelist.
   - Reuse trusted cluster metadata so Gravitino-managed cluster tables emit 
`ON CLUSTER`.
   - Avoid logging setting values; diagnostic logs should contain only 
validated setting names.
   
   ### Additional context
   
   - Native ClickHouse 24.8.14.39 validation confirmed that individual `MODIFY 
SETTING` and `RESET SETTING` commands succeed for `merge_with_ttl_timeout`, 
while a single ALTER mixing MODIFY and RESET is rejected with code 62 
`SYNTAX_ERROR` without a partial metadata change.
   - `index_granularity` is a read-only negative example and returns 
`READONLY_SETTING`; it should not be advertised as mutable.
   - The proposed scope is limited to table-level settings. Column-level 
SETTINGS, quoted-comma SETTINGS load/recreate parsing, automatic 
rollback/retry, and new ReplicatedMergeTree compatibility claims are excluded.
   - Verification should include direct unit coverage, ClickHouse 24.8 
standalone modify/reset/load and error paths, and a trusted-cluster test that 
inspects `system.query_log` for the emitted `ON CLUSTER` SQL.
   


-- 
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]

Reply via email to