Skip to content

Commit

Permalink
Fix report queries with a date type cast
Browse files Browse the repository at this point in the history
The multi_truncate function takes a date but we where passing a
timestamp instead. Cast the type accordingly.
  • Loading branch information
marcospri committed Dec 17, 2024
1 parent b2a92df commit 941a6cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CREATE MATERIALIZED VIEW report.events AS (

translated_events AS (
SELECT
report.multi_truncate('week', timestamp) AS timestamp_week,
report.multi_truncate('week', timestamp::date) AS timestamp_week,
user_map.organization_id,
event_type.type::report.event_type AS event_type,
user_map.user_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CREATE MATERIALIZED VIEW report.group_activity AS (
WITH
launch_counts AS (
SELECT
report.multi_truncate('week', timestamp) AS timestamp_week,
report.multi_truncate('week', timestamp::date) AS timestamp_week,
group_id,
COUNT(1) AS launch_count
FROM report.group_map
Expand Down

0 comments on commit 941a6cc

Please sign in to comment.