v.20.3New Feature

Support for DEFAULT Expression Based on ALIAS Expression in Columns

Now it's possible to create a column with DEFAULT expression which depends on a column with default ALIAS expression. #9489 (alesapin)
Enable creating columns with DEFAULT expressions that depend on columns defined by ALIAS default expressions.

Why it matters

This feature allows users to define more complex default values in table columns by referencing columns that themselves have ALIAS expressions. It enhances schema expressiveness and flexibility, enabling layered default column computations.

How to use it

Define a column with a DEFAULT 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 = ...