Optimize your BigQuery storage and query performance through partitioning and clustering.
{{ config(
materialized='table',
partition_by={
"field": "orderdate",
"data_type": "date",
"granularity": "month"
},
cluster_by = ['customerid', 'orderid'],
)
}}
with orders AS (
select
orderid,
customerid,
employeeid,
orderdate,
price
from {{ source('mdm-prod', 'orders') }}
)
select * from orders