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

@ -46,7 +46,6 @@ async function clickhouseQuery(
...filters,
eventType: EVENT_TYPE.pageView,
});
const table = unit === 'hour' ? 'website_event_stats_hourly' : 'website_event_stats_daily';
return rawQuery(
`
@ -57,7 +56,7 @@ async function clickhouseQuery(
select
${getDateSQL('created_at', unit, timezone)} as t,
uniq(session_id) as y
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}