v.24.4New Feature
Added Persistent Virtual Columns and Enhanced Block Number Support in MergeTree
Added persistent virtual column_block_offsetwhich stores original number of row in block that was assigned at insert. Persistence of column_block_offsetcan be enabled by the MergeTree settingenable_block_offset_column. Added virtual column_part_data_versionwhich contains either min block number or mutation version of part. Persistent virtual column_block_numberis not considered experimental anymore. #60676 (Anton Popov).
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.