Skip to content

Commit

Permalink
Merge pull request #55 from fishtown-analytics/fix/bq-adapter
Browse files Browse the repository at this point in the history
session roll-up, remove repeated casting
  • Loading branch information
ericalouie authored Apr 5, 2019
2 parents fd9200a + e31e651 commit 11acf4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions macros/adapters/bigquery/pageviews/snowplow_page_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ page_pings as (

select
page_view_id,
min(timestamp(collector_tstamp)) as page_view_start,
max(timestamp(collector_tstamp)) as page_view_end,
min(cast(collector_tstamp as timestamp)) as page_view_start,
max(cast(collector_tstamp as timestamp)) as page_view_end,

struct(
max(doc_width) as doc_width,
Expand All @@ -205,7 +205,7 @@ page_pings as (
array_agg(struct(
event_id,
event,
timestamp(collector_tstamp) as collector_tstamp,
cast(collector_tstamp as timestamp) as collector_tstamp,
pp_xoffset_min,
pp_xoffset_max,
pp_yoffset_min,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sessions_agg as (

select
pv.session_id,
array_agg(pv order by pv.page_view_start) as all_pageviews
array_agg(pv order by pv.page_view_in_session_index) as all_pageviews

from relevant_page_views as pv
group by 1
Expand Down

0 comments on commit 11acf4b

Please sign in to comment.