only use hourly table, remove daily table logic, fix updatechart undefined

This commit is contained in:
Francis Cao 2024-07-23 22:35:11 -07:00
parent 038ecdb592
commit 174b9e4376
10 changed files with 38 additions and 166 deletions

View file

@ -51,8 +51,6 @@ async function clickhouseQuery(
eventType: EVENT_TYPE.customEvent,
});
const table = unit === 'hour' ? 'website_event_stats_hourly' : 'website_event_stats_daily';
return rawQuery(
`
select
@ -62,7 +60,7 @@ async function clickhouseQuery(
from (
select arrayJoin(event_name) as event_name,
created_at
from ${table} website_event
from website_event_stats_hourly website_event
where website_id = {websiteId:UUID}
and created_at between {startDate:DateTime64} and {endDate:DateTime64}
and event_type = {eventType:UInt32}