jiangxt2 opened a new issue, #12273:
URL: https://github.com/apache/gravitino/issues/12273
### Describe what's wrong
When loading a ClickHouse table that uses a MergeTree-family engine with
parameters — for example `ReplacingMergeTree(ts)` — Gravitino reads only the
engine name from `system.tables.engine` and discards the parameters in
parentheses.
After a create→load round-trip (or load of a pre-existing table), the engine
parameters are gone. `ReplacingMergeTree(ts)` becomes plain
`ReplacingMergeTree`,
which changes the table's deduplication behaviour.
The `system.tables.engine_full` column already contains the full engine
declaration (e.g. `ReplacingMergeTree(ts) ORDER BY id SETTINGS ...`), but it
is
only parsed for `Distributed` engines today.
### Error message and/or stacktrace
No error is thrown. The engine parameters are silently dropped — the table
loads
without them and subsequent DDL generation omits the parameters as well.
### How to reproduce
1. Start a Gravitino server with a ClickHouse catalog.
2. Create a table in ClickHouse with engine parameters:
```sql
CREATE TABLE test.t (id Int32, ts Int64) ENGINE = ReplacingMergeTree(ts)
ORDER BY id
```
3. Load the table via Gravitino:
```java
Table t = catalog.asTableCatalog().loadTable(NameIdentifier.of("test",
"t"));
```
4. Check `t.properties()` — no `engine_parameters` key exists, and the engine
is recorded as plain `ReplacingMergeTree`.
### Additional context
The following MergeTree-family engines accept parameters that affect
correctness
(not just performance):
| Engine | Example parameter | Lost semantic |
|---|---|---|
| ReplacingMergeTree | `ts` (version column) | dedup behaviour |
| CollapsingMergeTree | `sign` (sign column) | collapse behaviour |
| VersionedCollapsingMergeTree | `sign, ver` | versioned collapse |
| SummingMergeTree | `(a, b)` (tuple of columns) | auto-sum columns |
| GraphiteMergeTree | `'config_section'` | graphite rollup config |
`AggregatingMergeTree` takes no parameters and is unaffected.
--
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]