Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
There are a lot of cases when GROUP BY does not handle "blanks" in (for example) dates.
There should be an option to fetch data with zeros in GROUP BY:
SELECT EventDate, count() FROM test.hits WHERE CounterID = 2841673 GROUP BY EventDate |
ORDER BY EventDate WITH FILL STEP 1 |
|
┌──EventDate─┬─count()─┐ |
│ 2014-03-17 │ 3 │
|
│ 2014-03-18 │ 0 │
|
│ 2014-03-19 │ 6 │
|
│ 2014-03-20 │ 0 │
|
│ 2014-03-21 │ 7 │
|
│ 2014-03-22 │ 6 │
|
└────────────┴─────────┘
|
Source: https://clickhouse.com/blog/en/2021/clickhouse-v21.12-released/#support-for-interval-operator-inside-with-fill-modifier-for-order-by-clause
New links: https://clickhouse.com/docs/en/whats-new/changelog/2021/
And: https://github.com/ClickHouse/ClickHouse/pull/30927
This is a very common use case when aggregating results.