jiangxt2 opened a new pull request, #12772:
URL: https://github.com/apache/gravitino/pull/12772

   ### What changes were proposed in this pull request?
   
   This change adds ALTER support for ClickHouse table-level settings exposed 
through the existing `settings.*` table-property namespace.
   
   - Map settings-only `TableChange.SetProperty` requests to `MODIFY SETTING` 
and settings-only `TableChange.RemoveProperty` requests to `RESET SETTING`.
   - Validate setting requests before opening a JDBC connection, reject 
duplicate or unsupported command-family mixtures, and serialize settings in 
deterministic key order.
   - Validate setting identifiers and scalar literals while leaving concrete 
setting mutability, range, and permission checks to ClickHouse.
   - Preserve trusted `ON CLUSTER` behavior and avoid logging setting values.
   - Document the supported property contract and its scope boundaries.
   
   ### Why are the changes needed?
   
   The ClickHouse catalog already loads table settings into `settings.*` 
properties and writes them during CREATE TABLE, but ALTER rejects attempts to 
set or remove those properties. Supporting MODIFY and RESET completes the 
table-settings lifecycle without requiring users to bypass Gravitino or 
recreate tables.
   
   Fix: #12768
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Users can modify or reset table-level ClickHouse `settings.*` 
properties through `alterTable`. Each request must contain only set operations 
or only remove operations; settings cannot be mixed with schema, comment, or 
index changes. Numeric and boolean values are unquoted ClickHouse scalar 
literals, while string values must be valid single-quoted literals. 
Non-`settings.*` table properties remain immutable.
   
   Column-level SETTINGS and quoted-comma SETTINGS load/recreate parsing are 
out of scope; this PR also makes no new ReplicatedMergeTree compatibility claim.
   
   ### How was this patch tested?
   
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test -PskipITs` — 
passed; 92 tests, 0 skipped, 0 failures, 0 errors.
   - `CatalogClickHouseIT.testAlterTableSettings` — passed against ClickHouse 
24.8.14.39, covering numeric and string modify/load/reset plus 
`READONLY_SETTING` and `UNKNOWN_SETTING` propagation.
   - `CatalogClickHouseIT.testAlterTableSettingReadOnlyConnectionError` — 
passed against ClickHouse 24.8.14.39 with ClickHouse JDBC 0.7.1 
`custom_settings=readonly%3D1`.
   - `CatalogClickHouseClusterIT.testAlterTableSettingsOnCluster` — passed 
against the project cluster fixture; `system.query_log` verified that both 
MODIFY and RESET SQL contain `ON CLUSTER` (`tests=1`, `skipped=0`, 
`failures=0`, `errors=0`).
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:spotlessCheck` — 
passed.
   - `./gradlew rat` — passed.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:build -x test` — 
passed.
   - A local-only supplemental Gravitino precheck completed without errors.
   


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