-- models/marts/dim_preet.sql
{{ config(
materialized = 'incremental',
unique_key = 'role_id'
) }}
with experience as (
select 'Data Engineer' as role,
'Fornax' as company,
date '2024-11-01' as valid_from,
cast(null as date) as valid_to
union all
select 'Analytics Engineer',
'Dharma Diamonds',
date '2023-07-01',
date '2024-10-31'
),
stack as (
select tool
from unnest([
'SQL', 'Python', 'dbt', 'BigQuery',
'Trino', 'Apache Iceberg', 'Spark',
'Power BI', 'Semantic layer'
]) as tool
),
proof as (
select 33 as models_in_one_release,
15 as dashboards_owned
)
select
e.role,
e.company,
e.valid_from,
e.valid_to,
p.models_in_one_release,
p.dashboards_owned,
array_agg(s.tool) as stack
from experience e
cross join proof p
cross join stack s
where e.valid_to is null
group by 1, 2, 3, 4, 5, 6
-- tests: unique, not_null, freshness
-- a green build is not the same as a right number
-- models/marts/dim_preet.sql
{{ config(
materialized = 'incremental',
unique_key = 'role_id'
) }}
with experience as (
select 'Data Engineer' as role,
'Fornax' as company,
date '2024-11-01' as valid_from,
cast(null as date) as valid_to
union all
select 'Analytics Engineer',
'Dharma Diamonds',
date '2023-07-01',
date '2024-10-31'
),
stack as (
select tool
from unnest([
'SQL', 'Python', 'dbt', 'BigQuery',
'Trino', 'Apache Iceberg', 'Spark',
'Power BI', 'Semantic layer'
]) as tool
),
proof as (
select 33 as models_in_one_release,
15 as dashboards_owned
)
select
e.role,
e.company,
e.valid_from,
e.valid_to,
p.models_in_one_release,
p.dashboards_owned,
array_agg(s.tool) as stack
from experience e
cross join proof p
cross join stack s
where e.valid_to is null
group by 1, 2, 3, 4, 5, 6
-- tests: unique, not_null, freshness
-- a green build is not the same as a right number
-- models/marts/dim_preet.sql
{{ config(
materialized = 'incremental',
unique_key = 'role_id'
) }}
with experience as (
select 'Data Engineer' as role,
'Fornax' as company,
date '2024-11-01' as valid_from,
cast(null as date) as valid_to
union all
select 'Analytics Engineer',
'Dharma Diamonds',
date '2023-07-01',
date '2024-10-31'
),
stack as (
select tool
from unnest([
'SQL', 'Python', 'dbt', 'BigQuery',
'Trino', 'Apache Iceberg', 'Spark',
'Power BI', 'Semantic layer'
]) as tool
),
proof as (
select 33 as models_in_one_release,
15 as dashboards_owned
)
select
e.role,
e.company,
e.valid_from,
e.valid_to,
p.models_in_one_release,
p.dashboards_owned,
array_agg(s.tool) as stack
from experience e
cross join proof p
cross join stack s
where e.valid_to is null
group by 1, 2, 3, 4, 5, 6
-- tests: unique, not_null, freshness
-- a green build is not the same as a right number