v.21.9Improvement

Check Hash Function at Table Creation for MergeTree Settings

Check hash function at table creation, not at sampling. Add settings for MergeTree, if someone create a table with incorrect sampling column but sampling never be used, disable this settings for starting the server without exception. #26256 (zhaoyu).
Check hash function at table creation instead of at sampling time in MergeTree tables, with new settings to disable exceptions when incorrect sampling columns are defined but not used.

Why it matters

This feature addresses the issue where tables with incorrect sampling columns cause server startup exceptions even if sampling is never used. By validating the hash function at table creation rather than at sampling time and introducing settings to disable related exceptions, it improves server stability and flexibility when handling MergeTree tables with sampling clauses.

How to use it

When creating a MergeTree table, the hash function for the sampling key is checked immediately. If the sampling column is invalid but sampling is not used, you can enable the new server settings to disable exceptions on startup, allowing the server to start normally. Configure these settings in the server configuration file or via command line options to control this behavior.