v.22.1Improvement

Allow Virtual Columns in Materialized Views

Allow to use virtual columns in Materialized Views. Close #11210. #33482 (OnePiece).
Support for using virtual columns in Materialized Views in ClickHouse, allowing these columns to be referenced and utilized within the views.

Why it matters

Virtual columns are computed columns derived from existing data, and prior to this feature, they could not be accessed inside materialized views. This feature enables users to leverage virtual columns in materialized views, facilitating more flexible and powerful data transformations, and simplifying workflows by avoiding the need for duplicative calculations outside the view.

How to use it

To use virtual columns in materialized views, define the materialized view with a SELECT statement that references the virtual columns directly as if they were regular columns. The materialized view will then process and store data including these virtual columns automatically.