From 92acd8c1a76ae389942e86ff8f36ddf037c6830f Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Mon, 29 Aug 2022 13:32:30 -0700 Subject: [PATCH] fix CH query --- queries/analytics/event/getEventMetrics.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/queries/analytics/event/getEventMetrics.js b/queries/analytics/event/getEventMetrics.js index 84c00777..4a828e15 100644 --- a/queries/analytics/event/getEventMetrics.js +++ b/queries/analytics/event/getEventMetrics.js @@ -43,7 +43,7 @@ async function clickhouseQuery( unit = 'day', filters = {}, ) { - const { rawQuery, getDateQuery, getBetweenDates } = prisma; + const { rawQuery, getDateQuery, getBetweenDates, getFilterQuery } = clickhouse; const params = [website_id]; return rawQuery( @@ -54,7 +54,7 @@ async function clickhouseQuery( from event where website_id= $1 and ${getBetweenDates('created_at', start_at, end_at)} - ${clickhouse.getFilterQuery('event', filters, params)} + ${getFilterQuery('event', filters, params)} group by x, t order by t`, params,