v.19.14New Feature

WITH FILL Modifier for ORDER BY

WITH FILL modifier for ORDER BY. (continuation of #5069) #6610 (Anton Popov)
WITH FILL modifier support extended to the ORDER BY clause in ClickHouse, enabling automatic filling of missing values for ordered data sequences.

Why it matters

This feature addresses the need to fill gaps in ordered result sets directly within queries that include an ORDER BY clause. It simplifies data analysis by automatically generating rows for missing values, ensuring continuous sequences without manual data preparation or complex workarounds.

How to use it

Users can enable automatic filling of missing values by adding the WITH FILL modifier to their ORDER BY clause in a SELECT statement. For example:

SELECT
date,
count()
FROM
events
ORDER BY
date WITH FILL

This fills in any missing dates in the ordered sequence with default values.