v.23.5New Feature

WITH FILL Modifier for Sorting Prefix in ClickHouse

WITH FILL modifier groups filling by sorting prefix. Controlled by use_with_fill_by_sorting_prefix setting (enabled by default). Related to #33203#issuecomment-1418736794. #49503 (Igor Nikonov).
WITH FILL modifier now supports grouping filling by sorting prefix, improving control over gap filling in query results.

Why it matters

This feature enhances the WITH FILL clause by allowing it to group missing data points based on a sorting prefix. It solves the problem of incorrect or imprecise gap filling in time series or ordered data, providing more accurate and meaningful interpolation of missing rows for users.

How to use it

The new behavior is controlled by the use_with_fill_by_sorting_prefix setting, which is enabled by default. Users can rely on the enhanced filling logic without any change, or disable it by setting use_with_fill_by_sorting_prefix = 0 if the classic filling behavior is preferred.