Skip to content

Commit

Permalink
Add filter on SubjectCode to avoid nulls in array (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
keegansmith21 authored Oct 22, 2024
1 parent ea4d118 commit b46f06a
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,20 @@ onix_ebook_titles_raw as (
SELECT
subject.SubjectCode
FROM UNNEST(onix.Subjects) as subject
WHERE subject.SubjectSchemeIdentifier = "BIC_subject_category") as bic_subjects,
WHERE subject.SubjectSchemeIdentifier = "BIC_subject_category"
AND subject.SubjectCode IS NOT NULL) as bic_subjects,
ARRAY(
SELECT
subject.SubjectCode
FROM UNNEST(onix.Subjects) as subject
WHERE subject.SubjectSchemeIdentifier = "BISAC_Subject_Heading") as bisac_subjects,
WHERE subject.SubjectSchemeIdentifier = "BISAC_Subject_Heading"
AND subject.SubjectCode IS NOT NULL) as bisac_subjects,
ARRAY(
SELECT
subject.SubjectCode
FROM UNNEST(onix.Subjects) as subject
WHERE subject.SubjectSchemeIdentifier = "Thema_subject_category") as thema_subjects,
WHERE subject.SubjectSchemeIdentifier = "Thema_subject_category"
AND subject.SubjectCode IS NOT NULL) as thema_subjects,
(SELECT
custom_split(heading,';')
FROM UNNEST(onix.Subjects) as subject, UNNEST(subject.SubjectHeadingText) as heading
Expand Down

0 comments on commit b46f06a

Please sign in to comment.