v.21.4Improvements

Enhance MergeTree Table to Expose DateTime64 Values in System Parts and Columns

If partition key of a MergeTree table does not include Date or DateTime columns but includes exactly one DateTime64 column, expose its values in the min_time and max_time columns in system.parts and system.parts_columns tables. Add min_time and max_time columns to system.parts_columns table (these was inconsistency to the system.parts table). This closes #18244. #22011 (alexey-milovidov).
Expose min_time and max_time columns in system.parts and system.parts_columns tables for MergeTree tables whose partition key contains exactly one DateTime64 column but no Date or DateTime columns.

Why it matters

Previously, the system.parts_columns table lacked the min_time and max_time columns which were available in system.parts, causing inconsistency when the partition key includes a single DateTime64 column without Date or DateTime. This feature adds these columns to both tables, improving metadata consistency and making it easier for users to query time range information for such tables.

How to use it

No explicit user action is required. When using MergeTree tables with a partition key that contains exactly one DateTime64 column and no Date or DateTime columns, the system.parts and system.parts_columns tables will automatically expose min_time and max_time columns reflecting the partition's time boundaries.