This commit is contained in:
Pablo Martin 2023-10-31 17:22:51 +01:00
parent 2b6c385b8c
commit 7480222cc7
7 changed files with 49 additions and 13 deletions

View file

@ -0,0 +1,27 @@
{{
config(
materialized = 'table'
)
}}
WITH fact_reviews AS (
SELECT *
FROM
{{ ref('fact_reviews') }}
),
full_moon_dates AS (
SELECT *
FROM
{{ ref('seed_full_moon_dates')}}
)
SELECT
fr.*,
CASE
WHEN fm.full_moon_date IS NULL THEN 'not full moon'
ELSE 'full moon'
END AS is_full_moon
FROM
fact_reviews fr
LEFT JOIN full_moon_dates fm
ON (fr.review_date::date) = (fm.full_moon_date + interval '1' day)