From e8d6c5f01f1ec76c06af1b0864000591d2d4142d Mon Sep 17 00:00:00 2001 From: Eduard Gorkh <40689054+grkhr@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:57:17 +0200 Subject: [PATCH] 1inch: project orders materialize (#6064) * Update oneinch_project_orders.sql * inc predicate * inc pred to config --- models/oneinch/oneinch_project_orders.sql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/models/oneinch/oneinch_project_orders.sql b/models/oneinch/oneinch_project_orders.sql index 36c497c23de..e02589fd236 100644 --- a/models/oneinch/oneinch_project_orders.sql +++ b/models/oneinch/oneinch_project_orders.sql @@ -2,7 +2,11 @@ config( schema = 'oneinch', alias = 'project_orders', - materialized = 'view', + materialized = 'incremental', + file_format = 'delta', + incremental_strategy = 'merge', + partition_by = ['block_month'], + incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')], unique_key = ['blockchain', 'block_number', 'tx_hash', 'call_trace_address'] ) }} @@ -73,6 +77,9 @@ orders as ( from {{ ref('oneinch_lop') }} where call_success ) + {% if is_incremental() %} + where {{ incremental_predicate('block_time') }} + {% endif %} ) , prices as (