v.21.6Improvement

Add _partition_value Virtual Column to MergeTree for Deterministic Partition Pruning

Add _partition_value virtual column to MergeTree table family. It can be used to prune partition in a deterministic way. It's needed to implement partition matcher for mutations. #23673 (Amos Bird).
Introduced the _partition_value virtual column for the MergeTree table family. This column allows deterministic partition pruning during query execution.

Why it matters

Solve partition pruning challenges and enable more efficient mutation operations. The _partition_value virtual column provides a reliable way to reference and match partitions, which is especially useful when implementing partition matchers for mutations.

How to use it

Users can reference the _partition_value virtual column directly in queries on MergeTree tables to filter or prune partitions. For example, include _partition_value in the WHERE clause to limit the query scope deterministically by partition.