Merged PR 2167: Survey to Staging
Brings the CSAT response table from the backend to staging area. Related work items: #16947
This commit is contained in:
commit
28917fcc08
3 changed files with 32 additions and 0 deletions
|
|
@ -213,3 +213,5 @@ sources:
|
||||||
identifier: Country
|
identifier: Country
|
||||||
- name: VerificationSet
|
- name: VerificationSet
|
||||||
identifier: VerificationSet
|
identifier: VerificationSet
|
||||||
|
- name: GuestSatisfaction
|
||||||
|
identifier: GuestSatisfaction
|
||||||
|
|
|
||||||
|
|
@ -127,3 +127,10 @@ models:
|
||||||
tests:
|
tests:
|
||||||
- unique
|
- unique
|
||||||
- not_null
|
- not_null
|
||||||
|
|
||||||
|
- name: stg_core__guest_satisfaction_responses
|
||||||
|
columns:
|
||||||
|
- name: id_verification_request
|
||||||
|
tests:
|
||||||
|
- unique
|
||||||
|
- not_null
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
{{ config(materialized="incremental", unique_key="id_verification_request") }}
|
||||||
|
|
||||||
|
with
|
||||||
|
raw_guest_satisfaction as (select * from {{ source("core", "GuestSatisfaction") }}),
|
||||||
|
stg_core__guest_satisfaction_responses as (
|
||||||
|
select
|
||||||
|
{{ adapter.quote("VerificationRequestId") }} as id_verification_request,
|
||||||
|
{{ adapter.quote("ExperienceRating") }} as experience_rating,
|
||||||
|
{{ adapter.quote("IsContactable") }} as is_contactable,
|
||||||
|
{{ adapter.quote("Comments") }} as guest_comments,
|
||||||
|
{{ 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_guest_satisfaction
|
||||||
|
)
|
||||||
|
select *
|
||||||
|
from stg_core__guest_satisfaction_responses
|
||||||
|
{% if is_incremental() %}
|
||||||
|
where
|
||||||
|
updated_at_utc
|
||||||
|
>= ((select max(updated_at_utc) from {{ this }}) - interval '7 days')
|
||||||
|
{% endif %}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue