-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This update creates a new materialized view for transcript enabled/disabled events and updates `fact_transcript_usage` to use this new MV. This should improve the performance of transcript-related charts in Superset by avoiding relying on the base `xapi_events_all_parsed` table.
- Loading branch information
1 parent
d74b350
commit 47857ad
Showing
2 changed files
with
22 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{ config( | ||
materialized='materialized_view', | ||
engine='MergeTree()', | ||
primary_key='(org, course_key, video_id)', | ||
order_by='(org, course_key, video_id, emission_time, actor_id, cc_enabled, event_id)' | ||
) }} | ||
|
||
SELECT | ||
event_id, | ||
CAST(emission_time, 'DateTime') AS emission_time, | ||
org, | ||
splitByString('/', course_id)[-1] AS course_key, | ||
splitByString('/xblock/', object_id)[2] as video_id, | ||
actor_id, | ||
JSONExtractBool(event_str, 'result','extensions','https://w3id.org/xapi/video/extensions/cc-enabled') as cc_enabled | ||
FROM {{ ref('xapi_events_all_parsed') }} | ||
WHERE | ||
verb_id IN ('http://adlnet.gov/expapi/verbs/interacted') | ||
AND JSONHas(event_str, 'result', 'extensions', 'https://w3id.org/xapi/video/extensions/cc-enabled') |