CerebriumAI/airbyte_dbt_stripe

DISTINCT ON syntax does not work on Snowflake

Opened this issue · 0 comments

In the stripe__daily_overview model distinct on is used, but this syntax is not compatible with Snowflake:

select distinct on (subscription_payments.subscription_id)
subscription_payments.date,
subscription_id,
status,
customer_email,
canceled_at
from
subscription_payments
where
subscription_payments.date <= date_trunc('day', dt.date)
order by
subscription_id,
date desc
) as filtered_subs