Refactor projection settings: replace optional fields with generic SettingsChanges#101170
Refactor projection settings: replace optional fields with generic SettingsChanges#101170amosbird wants to merge 1 commit intoClickHouse:masterfrom
Conversation
|
Workflow [PR], commit [89468aa] Summary: ❌
AI ReviewSummaryThis PR refactors projection-level settings to use generic Missing context
ClickHouse Rules
Final Verdict
|
…ttingsChanges Replace per-projection optional index_granularity/index_granularity_bytes fields with a generic SettingsChanges map and has_index_granularity_overrides flag. Projections can now override any allowed MergeTreeSettings via a whitelist (part format, granularity, compression, serialization). Adds getDefaultSettings() and getMaxRows() to IProjectionIndex interface. Ref: ClickHouse#101170
…ttingsChanges Replace per-projection optional index_granularity/index_granularity_bytes fields with a generic SettingsChanges map and has_index_granularity_overrides flag. Projections can now override any allowed MergeTreeSettings via a whitelist (part format, granularity, compression, serialization). Adds getDefaultSettings() and getMaxRows() to IProjectionIndex interface. Ref: ClickHouse#101170
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
|
The |
0bf625d to
56f6afb
Compare
…ttingsChanges Replace per-projection `optional<UInt64> index_granularity/index_granularity_bytes` fields with a generic `SettingsChanges` map and `has_index_granularity_overrides` flag. Projections can now override any allowed MergeTreeSettings via a whitelist (part format, granularity, compression, serialization). Adds `getDefaultSettings` and `getMaxRows` to `IProjectionIndex` interface. The `index_granularity_bytes != 0` check is enforced unconditionally (both CREATE and ATTACH paths) to prevent projections from falling back to fixed granularity behavior.
56f6afb to
89468aa
Compare
LLVM Coverage Report
Changed lines: 91.60% (109/119) | lost baseline coverage: 4 line(s) · Uncovered code |
Replace per-projection optional
index_granularity/index_granularity_bytesfields with a genericSettingsChangesmap and ahas_index_granularity_overridesflag. This enables projections to override any allowedMergeTreeSettings, not just granularity.Changes:
ProjectionDescription: replaceoptional<UInt64> index_granularity/index_granularity_byteswithSettingsChanges settings_changesandbool has_index_granularity_overrides. RemoveloadSettings; validation now happens ingetProjectionFromAST.MergeTreeData::getSettings: acceptconst SettingsChanges *instead ofProjectionDescriptionRawPtr. Skip copy whensettings_changesis empty.IProjectionIndex: addgetDefaultSettingsandgetMaxRowsvirtual methods.getProjectionFromAST: acceptLoadingStrictnessLevel. OnCREATE, enforce anALLOWED_PROJECTION_SETTINGSwhitelist covering part format, granularity, compression, serialization, and related settings. RunsanityCheckand rejectindex_granularity_bytes = 0.04068_projection_index_settingscovering granularity overrides, ALTER+MATERIALIZE, DETACH/ATTACH persistence,min_bytes_for_wide_partoverride (Compact vs parent),min_compress_block_sizeoverride, disallowed settings rejection, and non-adaptive table rejection.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Allow projections to override additional MergeTree settings (compression, part format, serialization) beyond just
index_granularity, with a whitelist of allowed settings and validation.Documentation entry for user-facing changes