From c229f7466fe6d625cf869f755a853acc8918bc18 Mon Sep 17 00:00:00 2001 From: seojcarlos Date: Wed, 8 Apr 2026 08:22:49 +0200 Subject: [PATCH] fix: revert arrayMap on stats_hourly to avoid misaligned arrays The website_event_stats_hourly materialized view stores url_path and url_query as independently filtered arrays, so their indices do not correspond event-by-event. Using arrayMap to zip them would produce wrong URL pairings and silently drop entries. Reverted the stats_hourly path to use arrayJoin(url_path) as before. The url_query concatenation still works correctly on direct website_event queries (both PostgreSQL and ClickHouse). --- src/queries/sql/pageviews/getPageviewMetrics.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/queries/sql/pageviews/getPageviewMetrics.ts b/src/queries/sql/pageviews/getPageviewMetrics.ts index 549dd5ed8..a5d26f66e 100644 --- a/src/queries/sql/pageviews/getPageviewMetrics.ts +++ b/src/queries/sql/pageviews/getPageviewMetrics.ts @@ -163,9 +163,7 @@ async function clickhouseQuery( `; } else { let groupByQuery = ''; - let columnQuery = isPathType - ? `arrayJoin(arrayMap((p, q) -> if(q != '', concat(p, '?', q), p), url_path, url_query))` - : `arrayJoin(${column})`; + let columnQuery = `arrayJoin(${column})`; if (column === 'referrer_domain') { excludeDomain = `and t != ''`;