From aad2a1e53b875a413ff2bcd8d55ca0f35d5abbd8 Mon Sep 17 00:00:00 2001 From: Vasili Zakharko Date: Mon, 22 Jul 2024 17:17:29 +0300 Subject: [PATCH] feature: create base tpdm/edfi_3 models iteration 2 --- models/staging/edfi_3/base/_edfi_3__base.yml | 15 +++++ ...se_ef3__performance_evaluation_ratings.sql | 16 +++++ .../base_ef3__performance_evaluations.sql | 16 +++++ .../staging/edfi_3/base/base_ef3__persons.sql | 16 +++++ .../base/base_ef3__rubric_dimensions.sql | 16 +++++ ...f3__survey_section_aggregate_responses.sql | 16 +++++ models/staging/tpdm/base/_tpdm__base.yml | 50 ++++++++++++---- .../staging/tpdm/base/base_tpdm__persons.sql | 16 +++++ ...base_tpdm__post_secondary_institutions.sql | 34 +++++++++++ .../staging/tpdm/base/base_tpdm__schools.sql | 52 ++++++++++++++++ .../staging/tpdm/base/base_tpdm__sections.sql | 52 ++++++++++++++++ .../base_tpdm__student_academic_records.sql | 59 +++++++++++++++++++ .../staging/tpdm/base/base_tpdm__students.sql | 43 ++++++++++++++ .../tpdm/base/base_tpdm__survey_responses.sql | 35 +++++++++++ ...dm__survey_section_aggregate_responses.sql | 16 +++++ .../base_tpdm__survey_section_responses.sql | 23 ++++++++ .../tpdm/base/base_tpdm__survey_sections.sql | 21 +++++++ 17 files changed, 486 insertions(+), 10 deletions(-) create mode 100644 models/staging/edfi_3/base/base_ef3__performance_evaluation_ratings.sql create mode 100644 models/staging/edfi_3/base/base_ef3__performance_evaluations.sql create mode 100644 models/staging/edfi_3/base/base_ef3__persons.sql create mode 100644 models/staging/edfi_3/base/base_ef3__rubric_dimensions.sql create mode 100644 models/staging/edfi_3/base/base_ef3__survey_section_aggregate_responses.sql create mode 100644 models/staging/tpdm/base/base_tpdm__persons.sql create mode 100644 models/staging/tpdm/base/base_tpdm__post_secondary_institutions.sql create mode 100644 models/staging/tpdm/base/base_tpdm__schools.sql create mode 100644 models/staging/tpdm/base/base_tpdm__sections.sql create mode 100644 models/staging/tpdm/base/base_tpdm__student_academic_records.sql create mode 100644 models/staging/tpdm/base/base_tpdm__students.sql create mode 100644 models/staging/tpdm/base/base_tpdm__survey_responses.sql create mode 100644 models/staging/tpdm/base/base_tpdm__survey_section_aggregate_responses.sql create mode 100644 models/staging/tpdm/base/base_tpdm__survey_section_responses.sql create mode 100644 models/staging/tpdm/base/base_tpdm__survey_sections.sql diff --git a/models/staging/edfi_3/base/_edfi_3__base.yml b/models/staging/edfi_3/base/_edfi_3__base.yml index 50f4ff4..859f5a3 100644 --- a/models/staging/edfi_3/base/_edfi_3__base.yml +++ b/models/staging/edfi_3/base/_edfi_3__base.yml @@ -79,9 +79,21 @@ models: - name: base_ef3__parents config: tags: ['core'] + - name: base_ef3__performance_evaluation_ratings + config: + tags: ['core ???'] + - name: base_ef3__performance_evaluations + config: + tags: ['core ???'] + - name: base_ef3__persons + config: + tags: ['core'] - name: base_ef3__programs config: tags: ['core'] + - name: base_ef3__rubric_dimensions + config: + tags: ['core'] - name: base_ef3__schools config: tags: ['core'] @@ -194,6 +206,9 @@ models: - name: base_ef3__survey_sections config: tags: ['survey'] + - name: base_ef3__survey_section_aggregate_responses + config: + tags: ['survey'] - name: base_ef3__survey_section_responses config: tags: ['survey'] diff --git a/models/staging/edfi_3/base/base_ef3__performance_evaluation_ratings.sql b/models/staging/edfi_3/base/base_ef3__performance_evaluation_ratings.sql new file mode 100644 index 0000000..2e75141 --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__performance_evaluation_ratings.sql @@ -0,0 +1,16 @@ +with performance_evaluation_ratings as ( + {{ source_edfi3('performance_evaluation_ratings') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + filename, + file_row_number, + is_deleted, + ?? + from performance_evaluation_ratings +) +select * from renamed diff --git a/models/staging/edfi_3/base/base_ef3__performance_evaluations.sql b/models/staging/edfi_3/base/base_ef3__performance_evaluations.sql new file mode 100644 index 0000000..ce3251d --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__performance_evaluations.sql @@ -0,0 +1,16 @@ +with performance_evaluations as ( + {{ source_edfi3('performance_evaluations') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + filename, + file_row_number, + is_deleted, + ?? + from performance_evaluations +) +select * from renamed diff --git a/models/staging/edfi_3/base/base_ef3__persons.sql b/models/staging/edfi_3/base/base_ef3__persons.sql new file mode 100644 index 0000000..4937abc --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__persons.sql @@ -0,0 +1,16 @@ +with persons as ( + {{ source_edfi3('persons') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + filename, + file_row_number, + is_deleted, + ??? + from persons +) +select * from renamed diff --git a/models/staging/edfi_3/base/base_ef3__rubric_dimensions.sql b/models/staging/edfi_3/base/base_ef3__rubric_dimensions.sql new file mode 100644 index 0000000..e39905c --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__rubric_dimensions.sql @@ -0,0 +1,16 @@ +with rubric_dimensions as ( + {{ source_edfi3('rubric_dimensions') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + filename, + file_row_number, + is_deleted, + ??? + from rubric_dimensions +) +select * from renamed diff --git a/models/staging/edfi_3/base/base_ef3__survey_section_aggregate_responses.sql b/models/staging/edfi_3/base/base_ef3__survey_section_aggregate_responses.sql new file mode 100644 index 0000000..c48bea1 --- /dev/null +++ b/models/staging/edfi_3/base/base_ef3__survey_section_aggregate_responses.sql @@ -0,0 +1,16 @@ +with survey_section_aggregate_responses as ( + {{ source_edfi3('survey_section_aggregate_responses') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + ?? + from survey_section_aggregate_responses +) +select * from renamed diff --git a/models/staging/tpdm/base/_tpdm__base.yml b/models/staging/tpdm/base/_tpdm__base.yml index 684b62e..e603a7e 100644 --- a/models/staging/tpdm/base/_tpdm__base.yml +++ b/models/staging/tpdm/base/_tpdm__base.yml @@ -7,39 +7,69 @@ models: - name: base_tpdm__educator_preparation_programs config: tags: ['tpdm'] - - name: base_tpdm__survey_response_person_target_associations - config: - tags: ['tpdm'] - name: base_tpdm__candidate_educator_preparation_program_associations config: tags: ['tpdm'] - name: base_tpdm__financial_aids config: tags: ['tpdm'] - - name: base_tpdm__rubric_dimensions + - name: base_tpdm__evaluations config: tags: ['tpdm'] - - name: base_tpdm__evaluations + - name: base_tpdm__evaluation_elements + config: + tags: ['tpdm'] + - name: base_tpdm__evaluation_element_ratings config: tags: ['tpdm'] - name: base_tpdm__evaluation_ratings config: tags: ['tpdm'] - - name: base_tpdm__performance_evaluations + - name: base_tpdm__evaluation_objectives + config: + tags: ['tpdm'] + - name: base_tpdm__evaluation_objective_ratings config: tags: ['tpdm'] - name: base_tpdm__performance_evaluation_ratings config: tags: ['tpdm'] - - name: base_tpdm__evaluation_objectives + - name: base_tpdm__performance_evaluations config: tags: ['tpdm'] - - name: base_tpdm__evaluation_objective_ratings + - name: base_tpdm__persons config: tags: ['tpdm'] - - name: base_tpdm__evaluation_elements + - name: base_tpdm__post_secondary_institutions config: tags: ['tpdm'] - - name: base_tpdm__evaluation_element_ratings + - name: base_tpdm__rubric_dimensions + config: + tags: ['tpdm'] + - name: base_tpdm__schools + config: + tags: ['tpdm'] + - name: base_tpdm__sections + config: + tags: ['tpdm'] + - name: base_tpdm__student_academic_records + config: + tags: ['tpdm'] + - name: base_tpdm__students + config: + tags: ['tpdm'] + - name: base_tpdm__survey_response_person_target_associations + config: + tags: ['tpdm'] + - name: base_tpdm__survey_responses + config: + tags: ['tpdm'] + - name: base_tpdm__survey_section_aggregate_responses + config: + tags: ['tpdm'] + - name: base_tpdm__survey_section_responses + config: + tags: ['tpdm'] + - name: base_tpdm__survey_sections config: tags: ['tpdm'] diff --git a/models/staging/tpdm/base/base_tpdm__persons.sql b/models/staging/tpdm/base/base_tpdm__persons.sql new file mode 100644 index 0000000..4937abc --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__persons.sql @@ -0,0 +1,16 @@ +with persons as ( + {{ source_edfi3('persons') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + filename, + file_row_number, + is_deleted, + ??? + from persons +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__post_secondary_institutions.sql b/models/staging/tpdm/base/base_tpdm__post_secondary_institutions.sql new file mode 100644 index 0000000..9ff872b --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__post_secondary_institutions.sql @@ -0,0 +1,34 @@ +with post_secondary_institutions as ( + {{ source_edfi3('post_secondary_institutions') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:postSecondaryInstitutionId::int as post_secondary_institution_id, + v:nameOfInstitution::string as name_of_institution, + v:shortNameOfInstitution::string as short_name_of_institution, + v:webSite::string as web_site, + -- descriptors + {{ extract_descriptor('v:postSecondaryInstitutionLevelDescriptor::string')}} as post_secondary_institution_level, + {{ extract_descriptor('v:administrativeFundingControlDescriptor::string')}} as administrative_funding_control, + {{ extract_descriptor('v:federalLocaleCodeDescriptor::string')}} as federal_locale_code, + {{ extract_descriptor('v:operationalStatusDescriptor::string')}} as operational_status_descriptor, + -- unflattened lists + v:categories as v_categories, + v:addresses as v_addresses, + v:identificationCodes as v_identification_codes, + v:indicators as v_indicators, + v:institutionTelephones as v_institution_telephones, + v:internationalAddresses as v_international_addresses, + v:mediumOfInstructions as v_medium_of_instructions + from post_secondary_institutions +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__schools.sql b/models/staging/tpdm/base/base_tpdm__schools.sql new file mode 100644 index 0000000..a1ba275 --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__schools.sql @@ -0,0 +1,52 @@ +with schools as ( + {{ source_edfi3('schools') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + v:id::string as record_guid, + v:schoolId::integer as school_id, + v:nameOfInstitution::string as school_name, + v:shortNameOfInstitution::string as school_short_name, + v:webSite::string as website, + v:localEducationAgencyReference:localEducationAgencyId as lea_id, + -- pull out school categories + case + when array_size(v:schoolCategories) = 1 + then {{ extract_descriptor('v:schoolCategories[0]:schoolCategoryDescriptor::string') }} + when array_size(v:schoolCategories) > 1 + then 'Multiple Categories' + else NULL + end as school_category, + -- descriptors + {{ extract_descriptor('v:schoolTypeDescriptor::string') }} as school_type, + {{ extract_descriptor('v:operationalStatusDescriptor::string') }} as operational_status, + {{ extract_descriptor('v:administrativeFundingControlDescriptor::string') }} as administrative_funding_control, + {{ extract_descriptor('v:internetAccessDescriptor::string') }} as internet_access, + {{ extract_descriptor('v:titleIPartASchoolDesignationDescriptor::string') }} as title_i_part_a_school_designation, + {{ extract_descriptor('v:charterStatusDescriptor::string') }} as charter_status, + {{ extract_descriptor('v:charterApprovalAgencyTypeDescriptor::string') }} as charter_approval_agency, + {{ extract_descriptor('v:magnetSpecialProgramEmphasisSchoolDescriptor::string') }} as magnet_type, + -- references + v:localEducationAgencyReference as local_education_agency_reference, + -- unflattened lists + v:addresses as v_addresses, + v:educationOrganizationCategories as v_education_organization_categories, + v:gradeLevels as v_grade_levels, + v:identificationCodes as v_identification_codes, + v:indicators as v_indicators, + v:institutionTelephones as v_institution_telephones, + v:internationalAddresses as v_international_addresses, + v:schoolCategories as v_school_categories, + + -- edfi extensions + v:_ext as v_ext + from schools +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__sections.sql b/models/staging/tpdm/base/base_tpdm__sections.sql new file mode 100644 index 0000000..7483977 --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__sections.sql @@ -0,0 +1,52 @@ +with sections as ( + {{ source_edfi3('sections') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + v:id::string as record_guid, + v:sectionIdentifier::string as section_id, + v:sectionName::string as section_name, + -- course offering key + v:courseOfferingReference:schoolId::integer as school_id, + v:courseOfferingReference:localCourseCode::string as local_course_code, + v:courseOfferingReference:sessionName::string as session_name, + v:courseOfferingReference:schoolYear::integer as school_year, + -- location key + v:locationReference:classroomIdentificationCode::string as classroom_identification_code, + v:locationReference:schoolId::integer as classroom_location_school_id, + -- location school key + v:locationSchoolReference:schoolId::integer as school_location_school_id, + -- values + v:availableCreditConversion::float as available_credit_conversion, + v:availableCredits::float as available_credits, + v:sequenceOfCourse::integer as sequence_of_course, + v:officialAttendancePeriod::boolean as is_official_attendance_period, + -- descriptors + {{ extract_descriptor('v:availableCreditTypeDescriptor::string') }} as available_credit_type, + {{ extract_descriptor('v:educationalEnvironmentDescriptor::string') }} as educational_environment_type, + {{ extract_descriptor('v:instructionLanguageDescriptor::string') }} as instruction_language, + {{ extract_descriptor('v:mediumOfInstructionDescriptor::string') }} as medium_of_instruction, + {{ extract_descriptor('v:populationServedDescriptor::string') }} as population_served, + -- references + v:courseOfferingReference as course_offering_reference, + v:locationReference as location_reference, + v:locationSchoolReference as location_school_reference, + -- lists + v:characteristics as v_section_characteristics, + v:classPeriods as v_class_periods, + v:courseLevelCharacteristics as v_course_level_characteristics, + v:offeredGradeLevels as v_offered_grade_levels, + v:programs as v_programs, + + -- edfi extensions + v:_ext as v_ext + from sections +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__student_academic_records.sql b/models/staging/tpdm/base/base_tpdm__student_academic_records.sql new file mode 100644 index 0000000..f83df83 --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__student_academic_records.sql @@ -0,0 +1,59 @@ +with academic_records as ( + {{ source_edfi3('student_academic_records') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + v:id::string as record_guid, + -- identity components + v:educationOrganizationReference:educationOrganizationId::int as ed_org_id, + v:educationOrganizationReference:link:rel::string as ed_org_type, + v:schoolYearTypeReference:schoolYear::int as school_year, + v:studentReference:studentUniqueId::string as student_unique_id, + {{ extract_descriptor('v:termDescriptor::string') }} as academic_term, + -- non-identity components + v:cumulativeAttemptedCreditConversion::float as cumulative_attempted_credit_conversion, + v:cumulativeAttemptedCredits::float as cumulative_attempted_credits, + v:cumulativeEarnedCreditConversion::float as cumulative_earned_credit_conversion, + v:cumulativeEarnedCredits::float as cumulative_earned_credits, + v:projectedGraduationDate::date as projected_graduation_date, + v:sessionAttemptedCreditConversion::float as session_attempted_credit_conversion, + v:sessionAttemptedCredits::float as session_attempted_credits, + v:sessionEarnedCreditConversion::float as session_earned_credit_conversion, + v:sessionEarnedCredits::float as session_earned_credits, + v:classRanking:classRank::float as class_rank, + v:classRanking:totalNumberInClass::float as class_rank_total_students, + v:classRanking:percentageRanking::float as class_percent_rank, + v:classRanking:classRankingDate::date as class_rank_date, + -- deprecated components (use gpa list instead) + v:cumulativeGradePointAverage::float as cumulative_gpa, + v:cumulativeGradePointsEarned::float as cumulative_grade_points_earned, + v:gradeValueQualifier::string as grade_value_qualifier, + v:sessionGradePointAverage::float as session_gpa, + v:sessionGradePointsEarned::float as session_grade_points_earned, + -- descriptors + {{ extract_descriptor('v:sessionEarnedCreditTypeDescriptor::string') }} as session_earned_credit_type, + {{ extract_descriptor('v:sessionAttemptedCreditTypeDescriptor::string') }} as session_attempted_credit_type, + {{ extract_descriptor('v:cumulativeEarnedCreditTypeDescriptor::string') }} as cumulative_earned_credit_type, + {{ extract_descriptor('v:cumulativeAttemptedCreditTypeDescriptor::string') }} as cumulative_attempted_credit_type, + -- references + v:studentReference as student_reference, + v:educationOrganizationReference as education_organization_reference, + -- lists + v:academicHonors as v_academic_honors, + v:diplomas as v_diplomas, + v:gradePointAverages as v_grade_point_averages, + v:recognitions as v_recognitions, + v:reportCards as v_report_cards, + + -- edfi extensions + v:_ext as v_ext + from academic_records +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__students.sql b/models/staging/tpdm/base/base_tpdm__students.sql new file mode 100644 index 0000000..ad32299 --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__students.sql @@ -0,0 +1,43 @@ +with students as ( + {{ source_edfi3('students') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + v:id::string as record_guid, + v:studentUniqueId::string as student_unique_id, + v:firstName::string as first_name, + v:middleName::string as middle_name, + v:lastSurname::string as last_name, + v:generationCodeSuffix::string as generation_code_suffix, + v:maidenName::string as maiden_name, + v:personalTitlePrefix::string as personal_title_prefix, + v:personReference:personId::string as person_id, + v:birthDate::date as birth_date, + v:birthCity::string as birth_city, + v:birthInternationalProvince::string as birth_international_province, + v:dateEnteredUS::date as date_entered_us, + v:multipleBirthStatus::boolean as is_multiple_birth, + -- descriptors + {{ extract_descriptor('v:personReference:sourceSystemDescriptor::string') }} as person_source_system, + {{ extract_descriptor('v:birthSexDescriptor::string') }} as birth_sex, + {{ extract_descriptor('v:citizenshipStatusDescriptor::string') }} as citizenship_status, + {{ extract_descriptor('v:birthStateAbbreviationDescriptor::string') }} as birth_state, + {{ extract_descriptor('v:birthCountryDescriptor::string') }} as birth_country, + -- nested lists + v:identificationDocuments as v_identification_documents, + v:otherNames as v_other_names, + v:personalIdentificationDocuments as v_personal_identification_documents, + v:visas as v_visas, + + -- edfi extensions + v:_ext as v_ext + from students +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__survey_responses.sql b/models/staging/tpdm/base/base_tpdm__survey_responses.sql new file mode 100644 index 0000000..1d250ba --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__survey_responses.sql @@ -0,0 +1,35 @@ +with survey_responses as ( + {{ source_edfi3('survey_responses') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:surveyReference:surveyIdentifier::string as survey_id, + v:surveyReference:namespace::string as namespace, + v:surveyResponseIdentifier::string as survey_response_id, + v:studentReference:studentUniqueId::string as student_unique_id, + v:electronicMailAddress::string as electronic_mail_address, + v:fullName::string as full_name, + v:location::string as location, + v:responseDate::date as response_date, + v:responseTime::int as completion_time_seconds, + --references + v:surveyReference as survey_reference, + v:studentReference as student_reference, + v:staffReference as staff_reference, + v:parentReference as parent_reference, + -- lists + v:surveyLevels as v_survey_levels, + -- edfi extensions + v:_ext as v_ext + from survey_responses +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__survey_section_aggregate_responses.sql b/models/staging/tpdm/base/base_tpdm__survey_section_aggregate_responses.sql new file mode 100644 index 0000000..c48bea1 --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__survey_section_aggregate_responses.sql @@ -0,0 +1,16 @@ +with survey_section_aggregate_responses as ( + {{ source_edfi3('survey_section_aggregate_responses') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + ?? + from survey_section_aggregate_responses +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__survey_section_responses.sql b/models/staging/tpdm/base/base_tpdm__survey_section_responses.sql new file mode 100644 index 0000000..78bb06f --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__survey_section_responses.sql @@ -0,0 +1,23 @@ +with section_responses as ( + {{ source_edfi3('section_responses') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:surveyResponseReference:surveyResponseIdentifier::string as survey_response_id, + v:surveySectionReference:surveyIdentifier::string as survey_id, + v:sectionRating::decimal(9,3) as section_rating, + -- references + v:surveyResponseReference as survey_response_reference, + v:surveySectionReference as survey_section_reference + from section_responses +) +select * from renamed diff --git a/models/staging/tpdm/base/base_tpdm__survey_sections.sql b/models/staging/tpdm/base/base_tpdm__survey_sections.sql new file mode 100644 index 0000000..9b40ea5 --- /dev/null +++ b/models/staging/tpdm/base/base_tpdm__survey_sections.sql @@ -0,0 +1,21 @@ +with survey_sections as ( + {{ source_edfi3('survey_sections') }} +), +renamed as ( + select + tenant_code, + api_year, + pull_timestamp, + last_modified_timestamp, + file_row_number, + filename, + is_deleted, + + v:id::string as record_guid, + v:surveyReference::surveyIdentifier::string as survey_id, + v:surveySectionTitle::string as survey_section_title, + -- references + v:surveyReference as survey_reference + from survey_sections +) +select * from renamed