Sean Callahan
04/18/2023, 12:43 AMAmy Wang
04/18/2023, 1:05 AMSean Callahan
04/18/2023, 1:21 AMAmy Wang
04/18/2023, 2:47 AMBolek Ziobrowski
04/18/2023, 7:34 AMwith aggData as (
select timestamp_floor('h', timestamp) as hour, sum(count) as requests_per_hour from api_usage where timestamp >= dateadd('d', -1, timestamp_floor('d', now()))
group by hour
order by hour
), series as (
select dateadd('h', -25+x::int, timestamp_floor('d', now())) as ts from long_sequence(24)
)
select * from series s left join aggData a on s.ts = a.hour;
I think the issue here is that timestamp_sequence is not materialized so it should only be used to fill tables with data in simple queries .
See https://questdb.io/docs/reference/function/random-value-generator#usage .Sean Callahan
04/18/2023, 2:37 PMNicolas Hourcard
04/18/2023, 4:36 PMSean Callahan
04/18/2023, 4:40 PMNicolas Hourcard
04/18/2023, 4:51 PMSean Callahan
04/18/2023, 5:51 PMNicolas Hourcard
04/18/2023, 10:20 PMjavier ramirez
04/19/2023, 9:25 AM