rename silver pk fields

This commit is contained in:
forgash_ 2023-11-09 10:38:15 -07:00
parent 5fb0a148e8
commit b7e4e3e52d
11 changed files with 16 additions and 16 deletions

View File

@ -7,7 +7,7 @@
WITH nft_data AS (
SELECT
id AS ez_nft_contract_metrics_id,
atlas_nft_table_id AS ez_nft_contract_metrics_id,
receiver_id,
tokens,
transfers_24h,

View File

@ -7,7 +7,7 @@
WITH nft_detailed AS (
SELECT
id AS ez_nft_contract_metrics_daily_id,
atlas_nft_detailed_id AS ez_nft_contract_metrics_daily_id,
DAY,
receiver_id,
tokens,

View File

@ -7,7 +7,7 @@
WITH TRAILING AS (
SELECT
id AS fact_nft_monthly_txs_id,
atlas_nft_30_trailing_id AS fact_nft_monthly_txs_id,
DAY,
txns,
inserted_timestamp,

View File

@ -1,6 +1,6 @@
{{ config(
materialized = 'incremental',
unique_key = 'id',
unique_key = 'atlas_nft_30_trailing_id',
incremental_strategy = "merge",
merge_exclude_columns = ["inserted_timestamp"],
tags = ['atlas']
@ -39,7 +39,7 @@ FINAL AS (
SELECT
{{ dbt_utils.generate_surrogate_key(
['day']
) }} AS id,
) }} AS atlas_nft_30_trailing_id,
DAY,
txns,
SYSDATE() AS inserted_timestamp,

View File

@ -6,7 +6,7 @@ models:
This incremental dbt model generates a summary of NFT transactions from the 'silver__atlas_nft_transactions' table. It provides a daily count of transactions, accounting for a 30-day lookback period for each day within the specified date range.
columns:
- name: id
- name: atlas_nft_30_trailing_id
description: "{{ doc('id')}}"
tests:
- not_null

View File

@ -1,6 +1,6 @@
{{ config(
materialized = 'table',
unique_key = 'id',
unique_key = 'atlas_nft_detailed_id',
tags = ['atlas']
) }}
@ -14,7 +14,7 @@ WITH nft_data AS (
SELECT
{{ dbt_utils.generate_surrogate_key(
['DAY', 'receiver_id']
) }} AS id,
) }} AS atlas_nft_detailed_id,
DAY,
receiver_id,
COUNT(

View File

@ -6,7 +6,7 @@ models:
This is an incremental dbt model that gives an overview of NFT transactions in NEAR.
columns:
- name: id
- name: atlas_nft_detailed_id
description: "{{ doc('id')}}"
tests:
- not_null

View File

@ -1,6 +1,6 @@
{{ config(
materialized = 'table',
unique_key = 'id',
unique_key = 'atlas_nft_table_id',
tags = ['atlas']
) }}
@ -14,7 +14,7 @@ WITH nft_data AS (
SELECT
{{ dbt_utils.generate_surrogate_key(
['receiver_id']
) }} AS id,
) }} AS atlas_nft_table_id,
receiver_id,
COUNT(
DISTINCT token_id

View File

@ -6,7 +6,7 @@ models:
This view model provides a breakdown of NFT transaction activities by receiver_id. It includes counts of unique tokens, transfers within the last 24 hours and 3 days, all transfers, unique owners, total transactions, and minting events.
columns:
- name: id
- name: atlas_nft_table_id
description: "{ { doc('id')}}"
tests:
- unique

View File

@ -1,7 +1,7 @@
{{ config(
materialized = "incremental",
cluster_by = ["day"],
unique_key = "id",
unique_key = "atlas_nft_transactions_id",
merge_exclude_columns = ["inserted_timestamp"],
incremental_strategy = "merge",
tags = ['atlas']
@ -72,7 +72,7 @@ unioned_nft_data AS (
SELECT
{{ dbt_utils.generate_surrogate_key(
['receipt_object_id', 'method_name', 'token_id', 'owner']
) }} AS id,
) }} AS atlas_nft_transactions_id,
DAY,
tx_hash,
method_name,
@ -91,7 +91,7 @@ WHERE
token_id IS NOT NULL
AND owner IS NOT NULL
qualify ROW_NUMBER() over (
PARTITION BY id
PARTITION BY atlas_nft_transactions_id
ORDER BY
_inserted_timestamp DESC
) = 1

View File

@ -11,7 +11,7 @@ models:
interval: 1
columns:
- name: id
- name: atlas_nft_transactions_id
description: "{{doc('id')}}"
tests:
- unique