Merged PR 1985: Accommodation and AccommodationToUser to staging
Ingesting from Core into Staging. Related work items: #16919
This commit is contained in:
commit
8ba2ece28b
5 changed files with 68 additions and 2 deletions
|
|
@ -167,7 +167,7 @@ sources:
|
|||
- name: _airbyte_meta
|
||||
data_type: jsonb
|
||||
description: "{{ doc('_airbyte_meta_desc') }}"
|
||||
- name: superhog_user
|
||||
- name: SuperhogUser
|
||||
identifier: SuperhogUser
|
||||
- name: UserVerificationStatus
|
||||
identifier: UserVerificationStatus
|
||||
|
|
@ -205,3 +205,7 @@ sources:
|
|||
identifier: Integration
|
||||
- name: IntegrationType
|
||||
identifier: IntegrationType
|
||||
- name: Accommodation
|
||||
identifier: Accommodation
|
||||
- name: AccommodationToUser
|
||||
identifier: AccommodationToUser
|
||||
|
|
|
|||
|
|
@ -106,3 +106,17 @@ models:
|
|||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
|
||||
- name: stg_core__accommodation
|
||||
columns:
|
||||
- name: id_accommodation
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
|
||||
- name: stg_core__accommodation_to_user
|
||||
columns:
|
||||
- name: id_accommodation_to_user
|
||||
tests:
|
||||
- unique
|
||||
- not_null
|
||||
|
|
|
|||
30
models/staging/core/stg_core__accommodation.sql
Normal file
30
models/staging/core/stg_core__accommodation.sql
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
with
|
||||
raw_accommodation as (select * from {{ source("core", "Accommodation") }}),
|
||||
stg_core__accommodation as (
|
||||
select
|
||||
{{ adapter.quote("AccommodationId") }} as id_accommodation,
|
||||
{{ adapter.quote("CreatedByUserId") }} as id_creating_user,
|
||||
{{ adapter.quote("PaymentValidationSetId") }} as id_payment_validation_set,
|
||||
{{ adapter.quote("FriendlyName") }} as friendly_name,
|
||||
{{ adapter.quote("CountryId") }} as id_country,
|
||||
{{ adapter.quote("IsActive") }} as is_active,
|
||||
{{ adapter.quote("Town") }} as town,
|
||||
{{ adapter.quote("Postcode") }} as postcode,
|
||||
{{ adapter.quote("AddressLine1") }} as address_line_1,
|
||||
{{ adapter.quote("AddressLine2") }} as address_line_2,
|
||||
{{ adapter.quote("VerificationLevel") }} as verification_level,
|
||||
{{ adapter.quote("ManuallyValidated") }} as manually_validated,
|
||||
{{ adapter.quote("FloorArea") }} as floor_area,
|
||||
{{ adapter.quote("NumberOfFloors") }} as number_of_floors,
|
||||
{{ adapter.quote("NumberOfBedrooms") }} as number_of_bedrooms,
|
||||
{{ adapter.quote("NumberOfBathrooms") }} as number_of_bathrooms,
|
||||
{{ adapter.quote("NumberOfOtherRooms") }} as number_of_other_rooms,
|
||||
{{ adapter.quote("DetailsOfConstruction") }} as construction_details,
|
||||
{{ adapter.quote("CreatedDate") }} as created_at_utc,
|
||||
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
|
||||
from raw_accommodation
|
||||
)
|
||||
select *
|
||||
from stg_core__accommodation
|
||||
18
models/staging/core/stg_core__accommodation_to_user.sql
Normal file
18
models/staging/core/stg_core__accommodation_to_user.sql
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
with
|
||||
raw_accommodation_to_user as (
|
||||
select * from {{ source("core", "AccommodationToUser") }}
|
||||
),
|
||||
stg_core__accommodation_to_user as (
|
||||
select
|
||||
{{ adapter.quote("SuperhogUserId") }} as id_user_owner,
|
||||
{{ adapter.quote("AccommodationId") }} as id_accommodation,
|
||||
{{ adapter.quote("AccommodationToUserId") }} as id_accommodation_to_user,
|
||||
{{ adapter.quote("AccommodationUserType") }} as accommodation_user_type,
|
||||
{{ adapter.quote("CreatedDate") }} as created_at_utc,
|
||||
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
|
||||
from raw_accommodation_to_user
|
||||
)
|
||||
select *
|
||||
from stg_core__accommodation_to_user
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
}}
|
||||
|
||||
with
|
||||
raw_superhog_user as (select * from {{ source("core", "superhog_user") }}),
|
||||
raw_superhog_user as (select * from {{ source("core", "SuperhogUser") }}),
|
||||
stg_core__superhog_user as (
|
||||
select
|
||||
{{ adapter.quote("Avatar") }} as avatar,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue