v.22.12Improvement
Substitute UDFs in CREATE Query and Use as DEFAULT Expressions
Substitute UDFs inCREATEquery to avoid failures during loading at startup. Additionally, UDFs can now be used asDEFAULTexpressions for columns. #43539 (Antonio Andelic).
Why it matters
This feature addresses issues where queries using UDFs inCREATE statements could fail during server startup due to unresolved functions. By substituting UDFs appropriately, ClickHouse ensures smooth loading and initialization. Additionally, allowing UDFs as DEFAULT column expressions increases flexibility in defining default values based on custom logic, improving usability and expressiveness.How to use it
Define User-Defined Functions as usual, and then use them directly withinCREATE table queries, including as DEFAULT expressions for columns. ClickHouse will substitute the UDFs during parsing and loading to avoid errors, so no special configuration is required.