From 6d2036b687b08a7e955b91b2f1cfe77f100aa6d2 Mon Sep 17 00:00:00 2001 From: Sara Burns Date: Thu, 17 Oct 2024 10:16:10 -0400 Subject: [PATCH] fix: fix --- models/video/watched_video_duration.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/video/watched_video_duration.sql b/models/video/watched_video_duration.sql index dc776edb..f7771956 100644 --- a/models/video/watched_video_duration.sql +++ b/models/video/watched_video_duration.sql @@ -3,7 +3,7 @@ materialized="materialized_view", schema=env_var("ASPECTS_XAPI_DATABASE", "xapi"), engine=get_engine("ReplacingMergeTree()"), - order_by="(org,course_key,actor_id,video_id)", + order_by="(org,course_key,actor_id)", post_hook="OPTIMIZE TABLE {{ this }} {{ on_cluster() }} FINAL", ) }} @@ -114,7 +114,7 @@ select end ) as rewatched_time from course_data -left join range r on r.course_key = course_data.course_key +left join range on range.course_key = course_data.course_key left join rewatched r1 on range.event_id = r1.event_id1 left join rewatched r2 on range.event_id = r2.event_id2 -group by org, course_key, actor_id, video_id, video_duration +group by org, course_key, actor_id, video_count, video_duration