Merge Session/Event/Pageview CH

This commit is contained in:
Brian Cao 2022-09-12 09:55:34 -07:00
parent d377ef86e7
commit 52e036964b
18 changed files with 237 additions and 294 deletions

View file

@ -32,7 +32,7 @@ async function clickhouseQuery(websites, start_at) {
const { rawQuery, getDateFormat } = clickhouse;
return rawQuery(
`select
`select distinct
session_uuid,
website_id,
created_at,
@ -43,7 +43,7 @@ async function clickhouseQuery(websites, start_at) {
screen,
language,
country
from session
from event
where ${websites && websites.length > 0 ? `(website_id in (${websites.join[',']})` : '0 = 0'}
and created_at >= ${getDateFormat(start_at)}`,
);