v.20.3New Feature
Support for DEFAULT Expression Based on ALIAS Expression in Columns
Now it's possible to create a column withDEFAULTexpression which depends on a column with defaultALIASexpression. #9489 (alesapin)
Why it matters
This feature allows users to define more complex default values in table columns by referencing columns that themselves haveALIAS expressions. It enhances schema expressiveness and flexibility, enabling layered default column computations.How to use it
Define a column with aDEFAULT expression that references another column defined with an ALIAS default expression in your table schema. For example:CREATE TABLE example (
alias_col UInt32 ALIAS some_expression,
default_col UInt32 DEFAULT alias_col + 1
) ENGINE = ...