update market depth unique key

This commit is contained in:
mattromano 2026-01-20 10:23:19 -08:00
parent daa2f2d5bc
commit 423ab7fb42

View File

@ -8,7 +8,7 @@
materialized = 'incremental',
incremental_strategy = 'merge',
full_refresh = false,
unique_key = ['product_id','hour','price'],
unique_key = ['product_id','hour','price','orderbook_side'],
cluster_by = ['hour::DATE'],
tags = ['silver','curated','nado']
) }}
@ -102,7 +102,7 @@ WITH market_depth AS ({% for item in range(55) %}
SELECT
*,
{{ dbt_utils.generate_surrogate_key(
['product_id','hour','price']
['product_id','hour','price','orderbook_side']
) }} AS nado_market_depth_id,
SYSDATE() AS inserted_timestamp,
'{{ invocation_id }}' AS _invocation_id