update CH rawquery and type

This commit is contained in:
Francis Cao 2023-09-29 11:00:06 -07:00
parent d13f0bc5fe
commit e2bb2defd4
17 changed files with 169 additions and 52 deletions

View file

@ -172,7 +172,7 @@ async function clickhouseQuery(
);
}
return rawQuery<{ level: number; count: number }[]>(
return rawQuery(
`
WITH level0 AS (
select distinct session_id, url_path, referrer_path, created_at
@ -201,7 +201,7 @@ async function clickhouseQuery(
).then(results => {
return urls.map((a, i) => ({
x: a,
y: results[i]?.count || 0,
y: Number(results[i]?.count) || 0,
z: (1 - Number(results[i]?.count) / Number(results[i - 1]?.count)) * 100 || 0, // drop off
}));
});