From 83880dd27c01b814c2b8390e4e9b58543f80d34a Mon Sep 17 00:00:00 2001 From: stanz Date: Wed, 10 Sep 2025 21:47:20 +0700 Subject: [PATCH] bronze v2 --- .../streamline/realtime/bronze__streamline_blocks.sql | 9 +++------ .../realtime/bronze__streamline_collections.sql | 7 ++----- .../streamline/realtime/bronze__streamline_fr_blocks.sql | 7 ++----- .../realtime/bronze__streamline_fr_collections.sql | 7 ++----- .../bronze__streamline_fr_transaction_results.sql | 7 ++----- .../realtime/bronze__streamline_fr_transactions.sql | 7 ++----- .../realtime/bronze__streamline_transaction_results.sql | 7 ++----- .../realtime/bronze__streamline_transactions.sql | 7 ++----- 8 files changed, 17 insertions(+), 41 deletions(-) diff --git a/models/bronze/streamline/realtime/bronze__streamline_blocks.sql b/models/bronze/streamline/realtime/bronze__streamline_blocks.sql index 21f9a0a..0cd2937 100644 --- a/models/bronze/streamline/realtime/bronze__streamline_blocks.sql +++ b/models/bronze/streamline/realtime/bronze__streamline_blocks.sql @@ -2,10 +2,7 @@ materialized = 'view' ) }} -{% set model = this.identifier.split("_") [-1] %} -{{ streamline_external_table_query( - model = 'blocks_v2', - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", - partition_name = "_partition_by_block_id", - unique_key = "id" +{{ streamline_external_table_query_v2( + model = "blocks_v2", + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER )" ) }} \ No newline at end of file diff --git a/models/bronze/streamline/realtime/bronze__streamline_collections.sql b/models/bronze/streamline/realtime/bronze__streamline_collections.sql index 17af227..ae8934d 100644 --- a/models/bronze/streamline/realtime/bronze__streamline_collections.sql +++ b/models/bronze/streamline/realtime/bronze__streamline_collections.sql @@ -2,10 +2,7 @@ materialized = 'view' ) }} -{% set model = this.identifier.split("_") [-1] %} -{{ streamline_external_table_query( +{{ streamline_external_table_query_v2( model = "collections_v2", - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", - partition_name = "_partition_by_block_id", - unique_key = "id" + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" ) }} diff --git a/models/bronze/streamline/realtime/bronze__streamline_fr_blocks.sql b/models/bronze/streamline/realtime/bronze__streamline_fr_blocks.sql index 9d5ba43..56d6923 100644 --- a/models/bronze/streamline/realtime/bronze__streamline_fr_blocks.sql +++ b/models/bronze/streamline/realtime/bronze__streamline_fr_blocks.sql @@ -2,10 +2,7 @@ materialized = 'view' ) }} -{% set model = this.identifier.split("_") [-1] %} -{{ streamline_external_table_FR_query( +{{ streamline_external_table_FR_query_v2( model = 'blocks_v2', - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", - partition_name = "_partition_by_block_id", - unique_key = "id" + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" ) }} diff --git a/models/bronze/streamline/realtime/bronze__streamline_fr_collections.sql b/models/bronze/streamline/realtime/bronze__streamline_fr_collections.sql index 8da341e..7882774 100644 --- a/models/bronze/streamline/realtime/bronze__streamline_fr_collections.sql +++ b/models/bronze/streamline/realtime/bronze__streamline_fr_collections.sql @@ -2,10 +2,7 @@ materialized = 'view' ) }} -{% set model = this.identifier.split("_") [-1] %} -{{ streamline_external_table_FR_query( +{{ streamline_external_table_FR_query_v2( model = 'collections_v2', - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", - partition_name = "_partition_by_block_id", - unique_key = "id" + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" ) }} diff --git a/models/bronze/streamline/realtime/bronze__streamline_fr_transaction_results.sql b/models/bronze/streamline/realtime/bronze__streamline_fr_transaction_results.sql index a354068..42a973a 100644 --- a/models/bronze/streamline/realtime/bronze__streamline_fr_transaction_results.sql +++ b/models/bronze/streamline/realtime/bronze__streamline_fr_transaction_results.sql @@ -2,12 +2,9 @@ materialized = 'view' ) }} -{% set model = this.identifier.split("_")[-2:] | join('_') %} -{{ streamline_external_table_FR_query( +{{ streamline_external_table_FR_query_v2( model = 'transaction_results_v2', - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", - partition_name = "_partition_by_block_id", - unique_key = "id" + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" ) }} diff --git a/models/bronze/streamline/realtime/bronze__streamline_fr_transactions.sql b/models/bronze/streamline/realtime/bronze__streamline_fr_transactions.sql index a3b7e5d..e7dc629 100644 --- a/models/bronze/streamline/realtime/bronze__streamline_fr_transactions.sql +++ b/models/bronze/streamline/realtime/bronze__streamline_fr_transactions.sql @@ -2,10 +2,7 @@ materialized = 'view' ) }} -{% set model = this.identifier.split("_") [-1] %} -{{ streamline_external_table_FR_query( +{{ streamline_external_table_FR_query_v2( model = 'transactions_v2', - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", - partition_name = "_partition_by_block_id", - unique_key = "id" + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" ) }} diff --git a/models/bronze/streamline/realtime/bronze__streamline_transaction_results.sql b/models/bronze/streamline/realtime/bronze__streamline_transaction_results.sql index 670b0ca..ca3f4bf 100644 --- a/models/bronze/streamline/realtime/bronze__streamline_transaction_results.sql +++ b/models/bronze/streamline/realtime/bronze__streamline_transaction_results.sql @@ -2,10 +2,7 @@ materialized = 'view' ) }} -{% set model = this.identifier.split("_")[-2:] | join('_') %} -{{ streamline_external_table_query( +{{ streamline_external_table_query_v2( model = 'transaction_results_v2', - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", - partition_name = "_partition_by_block_id", - unique_key = "id" + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" ) }} diff --git a/models/bronze/streamline/realtime/bronze__streamline_transactions.sql b/models/bronze/streamline/realtime/bronze__streamline_transactions.sql index 884d692..106175f 100644 --- a/models/bronze/streamline/realtime/bronze__streamline_transactions.sql +++ b/models/bronze/streamline/realtime/bronze__streamline_transactions.sql @@ -2,10 +2,7 @@ materialized = 'view' ) }} -{% set model = this.identifier.split("_") [-1] %} -{{ streamline_external_table_query( +{{ streamline_external_table_query_v2( model = 'transactions_v2', - partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)", - partition_name = "_partition_by_block_id", - unique_key = "id" + partition_function = "CAST(SPLIT_PART(SPLIT_PART(file_name, '/', 3), '_', 1) AS INTEGER)" ) }}