This commit is contained in:
Pablo Martin 2023-11-02 17:45:20 +01:00
parent 1e53b3895c
commit bccbff7205
3 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,27 @@
version: 2
models:
- name: dim_listings_cleansed
columns:
- name: listing_id
tests:
- unique
- not_null
- name: host_id
tests:
- not_null
- relationships:
to: ref('dim_hosts_cleansed')
field: host_id
- name: room_type
tests:
- accepted_values:
values: [
'Entire home/apt',
'Private room',
'Shared room',
'Hotel room'
]

View file

@ -0,0 +1,9 @@
SELECT *
FROM
{{ ref('fact_reviews') }} fr
LEFT JOIN
{{ ref('dim_listings_cleansed') }} dl
ON
fr.listing_id = dl.listing_id
WHERE
fr.review_date < dl.created_at

View file

@ -0,0 +1,5 @@
SELECT *
FROM
{{ ref('dim_listings_cleansed') }}
WHERE
mininum_nights < 1