attempt adding event data rows to output

not trying to join yet, just poking around
pull/2022/head
emma 2023-05-04 15:10:49 -04:00
parent 586529a5ca
commit 6de82cfd5e
2 changed files with 6 additions and 2 deletions

View File

@ -69,6 +69,7 @@ export interface WebsiteActive {
export interface WebsiteMetric {
x: string;
y: number;
d?: unknown;
}
export interface WebsiteMetricFilter {
@ -90,6 +91,7 @@ export interface WebsiteEventMetric {
x: string;
t: string;
y: number;
d?: unknown;
}
export interface WebsiteEventDataMetric {

View File

@ -54,6 +54,7 @@ async function relationalQuery(
return rawQuery(
`select
event_name x,
event_data d,
${getDateQuery('created_at', unit, timezone)} t,
count(*) y
from website_event
@ -62,8 +63,8 @@ async function relationalQuery(
and created_at between $3 and $4
and event_type = ${EVENT_TYPE.customEvent}
${filterQuery}
group by 1, 2
order by 2`,
group by 1, 3
order by 3`,
params,
);
}
@ -95,6 +96,7 @@ async function clickhouseQuery(
return rawQuery(
`select
event_name x,
event_data d,
${getDateQuery('created_at', unit, timezone)} t,
count(*) y
from website_event