v.25.8New Feature

Support the _table virtual column

Now all tables support the _table virtual column (not only tables with the Merge engine), which is especially useful for queries with UNION ALL. #63665 (Xiaozhe Yu).
The _table virtual column is now supported on all tables in ClickHouse, not just those with the Merge engine.

Why it matters

This feature provides users the ability to identify the source table in queries involving multiple tables, especially useful when performing UNION ALL operations. It simplifies query writing and improves clarity when combining data from multiple tables.

How to use it

Users can reference the _table virtual column directly in their queries across any table type. For example, in a SELECT statement with UNION ALL, include _table to distinguish rows according to their originating table.