v.24.4New Feature

Added Persistent Virtual Columns and Enhanced Block Number Support in MergeTree

Added persistent virtual column _block_offset which stores original number of row in block that was assigned at insert. Persistence of column _block_offset can be enabled by the MergeTree setting enable_block_offset_column. Added virtual column_part_data_version which contains either min block number or mutation version of part. Persistent virtual column _block_number is not considered experimental anymore. #60676 (Anton Popov).
Added persistent virtual column _block_offset to store the original row number within a block assigned at insert, with persistence controlled by the enable_block_offset_column MergeTree setting. Introduced virtual column _part_data_version showing the minimum block number or mutation version of a part. The persistent virtual column _block_number is no longer experimental.

Why it matters

These additions provide more granular metadata about rows and parts within MergeTree tables. They enable users to track original row positions within blocks and identify data versions or mutations applied to parts, improving debugging, auditing, and data processing accuracy.

How to use it

To enable the persistent _block_offset column, set enable_block_offset_column=1 in the MergeTree table settings. The new virtual column _part_data_version and the stable _block_number column can be selected directly in queries without additional configuration.