add staging model
This commit is contained in:
parent
501a063635
commit
a39f4d24aa
1 changed files with 26 additions and 0 deletions
26
models/staging/core/stg_core__BookingToProductBundle.sql
Normal file
26
models/staging/core/stg_core__BookingToProductBundle.sql
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
with
|
||||
raw_booking_to_product_bundle as (
|
||||
select * from {{ source("core", "BookingToProductBundle") }}
|
||||
),
|
||||
stg_core__booking_to_product_bundle as (
|
||||
select
|
||||
{{ adapter.quote("Id") }} as id_booking_to_product_bundle,
|
||||
{{ adapter.quote("BookingId") }} as id_booking,
|
||||
{{ adapter.quote("UserProductBundleId") }} as id_user_product_bundle,
|
||||
|
||||
{{ adapter.quote("StartDate") }} as starts_at_utc,
|
||||
{{ adapter.quote("EndDate") }} as ends_at_utc,
|
||||
case
|
||||
when {{ adapter.quote("EndDate") }} is null then true else false
|
||||
end as has_no_end_date,
|
||||
{{ adapter.quote("CreatedDate") }} as created_at_utc,
|
||||
cast({{ adapter.quote("CreatedDate") }} as date) as created_date_utc,
|
||||
{{ adapter.quote("UpdatedDate") }} as updated_at_utc,
|
||||
cast({{ adapter.quote("UpdatedDate") }} as date) as updated_date_utc,
|
||||
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at
|
||||
|
||||
from raw_booking_to_product_bundle
|
||||
)
|
||||
select *
|
||||
from stg_core__booking_to_product_bundle
|
||||
Loading…
Add table
Add a link
Reference in a new issue