Skip to content

Commit

Permalink
fix: split subtags
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Aug 29, 2024
1 parent 314f73d commit c90d547
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions models/courses/course_tags.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,22 @@ with
group by id
),
tags_table as (
select object_id, _value, lineage, trim(BOTH '\"\"' from arrayJoin(JSONExtractArrayRaw(lineage))) tag
select
object_id,
_value,
lineage,
trim(BOTH '\"\"' from arrayJoin(JSONExtractArrayRaw(lineage))) tag
from {{ source("event_sink", "object_tag") }} ot
inner join
most_recent_object_tags mrot
on mrot.id = ot.id
and ot.time_last_dumped = mrot.last_modified
)
select pt.course_key course_key, pt.course_name course_name, pt.taxonomy_name, tt.tag as tag, tt.lineage as lineage
select
pt.course_key course_key,
pt.course_name course_name,
pt.taxonomy_name,
tt.tag as tag,
tt.lineage as lineage
from parsed_tags pt
inner join tags_table tt on (course_key = object_id) and (pt.tag = _value)

0 comments on commit c90d547

Please sign in to comment.