From dbf485bc39d9d593dc31bf876618aa7b0f23074d Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 15 Feb 2024 16:25:43 +0100 Subject: [PATCH] adapt superhog user --- .../staging/core/stg_core__superhog_user.sql | 43 ++++++++++++------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/models/staging/core/stg_core__superhog_user.sql b/models/staging/core/stg_core__superhog_user.sql index 3ebb83a..8466da4 100644 --- a/models/staging/core/stg_core__superhog_user.sql +++ b/models/staging/core/stg_core__superhog_user.sql @@ -1,16 +1,27 @@ -with raw_superhog_user as (select * from {{ source("core", "superhog_user") }}) -select - cast(superhoguserid as uuid) as id_superhoguser, - avatar as avatar, - airbnbid as id_airbnb, - airbnburl as airbnb_url, - createddate as created_date_utc, - updateddate as updated_date_utc, - verifieddate as verified_date_utc, - flagasproblem as flag_as_problem, - numberofproperties as number_of_properties, - superhogverifiedsetid as id_superhog_verified_set, - platformcommsrecipient as platform_comms_recipient, - othersharingplatformurl as other_sharing_platform_url, - userverificationstatusid as id_user_verification_status -from raw_superhog_user +with + raw_superhog_user as (select * from {{ source("core", "superhog_user") }}), + stg_core__superhog_user as ( + select + {{ adapter.quote("Avatar") }} as avatar, + {{ adapter.quote("AirbnbId") }} as id_airbnb, + {{ adapter.quote("AirbnbUrl") }} as airbnb_url, + {{ adapter.quote("CreatedDate") }} as created_date_utc, + {{ adapter.quote("UpdatedDate") }} as updated_date_utc, + {{ adapter.quote("VerifiedDate") }} as verified_date_utc, + {{ adapter.quote("FlagAsProblem") }} as flag_as_problem, + {{ adapter.quote("SuperhogUserId") }} as id_superhoguser, + {{ adapter.quote("NumberOfProperties") }} as number_of_properties, + {{ adapter.quote("SuperhogVerifiedSetId") }} id_superhog_verified_set, + {{ adapter.quote("PlatformCommsRecipient") }} as platform_comms_recipient, + {{ adapter.quote("OtherSharingPlatformUrl") }} + as other_sharing_platform_url, + {{ adapter.quote("UserVerificationStatusId") }} + as id_user_verification_status + {{ adapter.quote("_airbyte_raw_id") }}, + {{ adapter.quote("_airbyte_extracted_at") }}, + {{ adapter.quote("_airbyte_meta") }} + + from raw_superhog_user + ) +select * +from stg_core__superhog_user