-
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.
Merge pull request #72 from SoryRawyer/rds/dim-course-blocks-extended
feat: add extended course block dimension table (FC-0051)
- Loading branch information
Showing
2 changed files
with
79 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
select | ||
blocks.org as org, | ||
blocks.course_key as course_key, | ||
blocks.course_name as course_name, | ||
blocks.course_run as course_run, | ||
blocks.block_id as block_id, | ||
blocks.block_name as block_name, | ||
blocks.section_number as section_number, | ||
blocks.subsection_number as subsection_number, | ||
blocks.hierarchy_location as hierarchy_location, | ||
blocks.display_name_with_location as display_name_with_location, | ||
blocks.graded as graded, | ||
blocks.block_type as block_type, | ||
section_blocks.display_name_with_location as section_with_name, | ||
subsection_blocks.display_name_with_location as subsection_with_name | ||
from {{ ref("dim_course_blocks") }} blocks | ||
left join | ||
{{ ref("dim_course_blocks") }} section_blocks | ||
on ( | ||
blocks.section_number = section_blocks.hierarchy_location | ||
and blocks.org = section_blocks.org | ||
and blocks.course_key = section_blocks.course_key | ||
and section_blocks.block_id like '%@chapter+block@%' | ||
) | ||
left join | ||
{{ ref("dim_course_blocks") }} subsection_blocks | ||
on ( | ||
blocks.subsection_number = subsection_blocks.hierarchy_location | ||
and blocks.org = subsection_blocks.org | ||
and blocks.course_key = subsection_blocks.course_key | ||
and subsection_blocks.block_id like '%@sequential+block@%' | ||
) |
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