v.18.12New Feature
Tables in MergeTree Family Gain Virtual Column _partition_id
Tables in the MergeTree family now have the virtual column _partition_id. #3089Why it matters
This feature introduces the virtual column_partition_id to allow users to easily access the partition identifier directly from MergeTree tables. It simplifies queries that require partition-related information without needing to extract or compute it manually.How to use it
Users can directly query the_partition_id column in their SELECT statements from any MergeTree family table to retrieve the partition identifier, for example:SELECT _partition_id, COUNT(*) FROM my_mergetree_table GROUP BY _partition_id