From fb86850ffe63b600392e1ccde2a6fa7fbffaf717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oriol=20Roqu=C3=A9=20Paniagua?= Date: Wed, 19 Jun 2024 08:40:08 +0000 Subject: [PATCH] Merged PR 2074: Adding country to staging Adding country to staging Related work items: #17312 --- .vscode/settings.json | 1 + models/staging/core/_core_sources.yml | 2 ++ models/staging/core/stg_core__country.sql | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 models/staging/core/stg_core__country.sql diff --git a/.vscode/settings.json b/.vscode/settings.json index d8d206c..67c4b1f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -31,4 +31,5 @@ "packages.yml" ] }, + "dbt.prefixGenerateModel": "stg" } \ No newline at end of file diff --git a/models/staging/core/_core_sources.yml b/models/staging/core/_core_sources.yml index eff5619..7381f0f 100644 --- a/models/staging/core/_core_sources.yml +++ b/models/staging/core/_core_sources.yml @@ -209,3 +209,5 @@ sources: identifier: Accommodation - name: AccommodationToUser identifier: AccommodationToUser + - name: Country + identifier: Country diff --git a/models/staging/core/stg_core__country.sql b/models/staging/core/stg_core__country.sql new file mode 100644 index 0000000..527129f --- /dev/null +++ b/models/staging/core/stg_core__country.sql @@ -0,0 +1,18 @@ +with raw_country as ( + select * from {{ source('core', 'Country') }} +), +stg_core__country as ( + select + {{ adapter.quote("Id") }} as id_country, + {{ adapter.quote("Iso") }} as iso_2, + {{ adapter.quote("Iso3") }} as iso_3, + {{ adapter.quote("Name") }} as country_name, + {{ adapter.quote("NumCode") }} as iso_num_code, + {{ adapter.quote("PhoneCode") }} as phone_code, + {{ adapter.quote("PreferredCurrencyId") }} as id_preferred_currency, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc + + from raw_country +) +select * from stg_core__country + \ No newline at end of file