v.21.12New Features

Support INTERVAL type in STEP clause for WITH FILL modifier

Support INTERVAL type in STEP clause for WITH FILL modifier. #30927 (Anton Popov).
Added support for the INTERVAL type in the STEP clause when using the WITH FILL modifier in ClickHouse queries.

Why it matters

This feature allows users to specify time intervals directly in the STEP clause for WITH FILL, making it easier to generate and fill time series data with consistent interval steps. It improves query expressiveness and usability for time-based data interpolation.

How to use it

Use the WITH FILL modifier together with a STEP clause that includes an INTERVAL value. For example:

SELECT 
event_date,
count(*)
FROM
events
GROUP BY
event_date
WITH FILL
STEP INTERVAL 1 DAY

This fills missing dates in the event_date column with a step of one day.