mirror of
https://github.com/FlipsideCrypto/near-models.git
synced 2026-02-06 14:11:54 +00:00
coalesce timestamps in gold
This commit is contained in:
parent
8dac4100f3
commit
2ab6b6b77f
@ -23,8 +23,8 @@ WITH nft_data AS (
|
||||
owners,
|
||||
transactions,
|
||||
mints,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__atlas_nft_table') }}
|
||||
)
|
||||
|
||||
@ -22,8 +22,8 @@ WITH nft_detailed AS (
|
||||
owners,
|
||||
transactions,
|
||||
mints,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__atlas_nft_detailed') }}
|
||||
)
|
||||
|
||||
@ -31,8 +31,8 @@ WITH supply AS (
|
||||
perc_staked_locked,
|
||||
perc_staked_circulating,
|
||||
atlas_supply_id AS ez_supply_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__atlas_supply') }}
|
||||
)
|
||||
|
||||
@ -17,8 +17,8 @@ WITH nft_data AS (
|
||||
atlas_account_created_id AS fact_accounts_created_id,
|
||||
DAY,
|
||||
wallets_created,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__atlas_accounts_created') }}
|
||||
)
|
||||
|
||||
@ -16,7 +16,7 @@ SELECT
|
||||
maa,
|
||||
new_maas,
|
||||
returning_maas,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__atlas_maa') }}
|
||||
|
||||
@ -17,8 +17,8 @@ WITH TRAILING AS (
|
||||
atlas_nft_30_trailing_id AS fact_nft_monthly_txs_id,
|
||||
DAY,
|
||||
txns,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__atlas_nft_30_trailing') }}
|
||||
)
|
||||
|
||||
@ -23,8 +23,8 @@ WITH flipside_labels AS (
|
||||
['address']
|
||||
) }}
|
||||
) AS dim_address_labels_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__address_labels') }}
|
||||
)
|
||||
|
||||
@ -22,7 +22,7 @@ SELECT
|
||||
['contract_address']
|
||||
) }}
|
||||
) AS dim_ft_contract_metadata_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
ft_contract_metadata
|
||||
|
||||
@ -12,8 +12,8 @@ WITH token_labels AS (
|
||||
token_contract,
|
||||
decimals,
|
||||
token_labels_id AS dim_token_labels_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__token_labels') }}
|
||||
),
|
||||
@ -30,8 +30,8 @@ nearblocks_fts_api AS (
|
||||
['token_contract']
|
||||
) }}
|
||||
) AS dim_token_labels_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__api_nearblocks_fts') }}
|
||||
),
|
||||
|
||||
@ -28,7 +28,7 @@ SELECT
|
||||
['receipt_object_id', 'action_index']
|
||||
) }}
|
||||
) AS fact_actions_events_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
actions
|
||||
|
||||
@ -29,7 +29,7 @@ SELECT
|
||||
['action_id']
|
||||
) }}
|
||||
) AS fact_actions_events_function_call_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
actions_events_function_call
|
||||
|
||||
@ -51,7 +51,7 @@ SELECT
|
||||
['block_id']
|
||||
) }}
|
||||
) AS fact_blocks_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
blocks
|
||||
|
||||
@ -17,14 +17,14 @@ SELECT
|
||||
DATA,
|
||||
provider,
|
||||
endpoint_github,
|
||||
_inserted_timestamp AS snapshot_timestamp,
|
||||
_COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp AS snapshot_timestamp,
|
||||
COALESCE(
|
||||
github_data_id,
|
||||
{{ dbt_utils.generate_surrogate_key(
|
||||
['_res_id']
|
||||
) }}
|
||||
) AS fact_developer_activity_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
github_data
|
||||
|
||||
@ -26,7 +26,7 @@ SELECT
|
||||
['action_id']
|
||||
) }}
|
||||
) AS fact_logs_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
logs
|
||||
|
||||
@ -31,7 +31,7 @@ SELECT
|
||||
['receipt_object_id']
|
||||
) }}
|
||||
) AS fact_receipts_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
receipts
|
||||
|
||||
@ -32,7 +32,7 @@ SELECT
|
||||
['tx_hash']
|
||||
) }}
|
||||
) AS fact_transactions_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
transactions
|
||||
|
||||
@ -29,7 +29,7 @@ SELECT
|
||||
['action_id']
|
||||
) }}
|
||||
) AS fact_transfers_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
transfers
|
||||
|
||||
@ -41,8 +41,8 @@ FINAL AS (
|
||||
amount_out_raw,
|
||||
amount_out,
|
||||
dex_swaps_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
dex_swaps
|
||||
WHERE
|
||||
@ -77,7 +77,7 @@ SELECT
|
||||
['swap_id']
|
||||
) }}
|
||||
) AS ez_dex_swaps_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
FINAL
|
||||
|
||||
@ -25,7 +25,7 @@ SELECT
|
||||
['tx_hash']
|
||||
) }}
|
||||
) AS dim_staking_pools_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
staking_pools
|
||||
|
||||
@ -26,8 +26,8 @@ WITH lockup_actions AS (
|
||||
['tx_hash']
|
||||
) }}
|
||||
) AS fact_lockup_actions_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__lockup_actions') }}
|
||||
)
|
||||
|
||||
@ -22,8 +22,8 @@ WITH staking_actions AS (
|
||||
['tx_hash']
|
||||
) }}
|
||||
) AS fact_staking_actions_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__staking_actions_v2') }}
|
||||
)
|
||||
|
||||
@ -20,8 +20,8 @@ WITH balance_changes AS (
|
||||
['tx_hash']
|
||||
) }}
|
||||
) AS fact_staking_pool_balances_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__pool_balances') }}
|
||||
)
|
||||
|
||||
@ -17,8 +17,8 @@ WITH daily_balance AS (
|
||||
['date_day', 'address']
|
||||
) }}
|
||||
) AS fact_staking_pool_daily_balances_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__pool_balance_daily') }}
|
||||
)
|
||||
|
||||
@ -24,8 +24,8 @@ WITH horizon AS (
|
||||
['action_id_horizon']
|
||||
) }}
|
||||
) AS fact_decoded_actions_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver_horizon__decoded_actions') }}
|
||||
WHERE
|
||||
|
||||
@ -23,7 +23,7 @@ SELECT
|
||||
['contract_address']
|
||||
) }}
|
||||
) AS dim_nft_contract_metadata_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
nft_contract_metadata
|
||||
|
||||
@ -23,7 +23,7 @@ SELECT
|
||||
['metadata_id']
|
||||
) }}
|
||||
) AS dim_nft_series_metadata_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
series_metadata
|
||||
|
||||
@ -33,8 +33,8 @@ WITH nft_mints AS (
|
||||
['mint_action_id']
|
||||
) }}
|
||||
) AS fact_nft_mints_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__standard_nft_mint_s3') }}
|
||||
)
|
||||
|
||||
@ -21,8 +21,8 @@ WITH oracle_prices AS (
|
||||
['block_id', 'token_contract']
|
||||
) }}
|
||||
) AS fact_prices_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver__prices_oracle_s3') }}
|
||||
)
|
||||
|
||||
@ -16,7 +16,7 @@ SELECT
|
||||
['action_id']
|
||||
) }}
|
||||
) AS fact_addkey_events_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver_social__addkey') }}
|
||||
|
||||
@ -17,7 +17,7 @@ SELECT
|
||||
['action_id_social']
|
||||
) }}
|
||||
) AS fact_decoded_actions_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver_social__decoded_actions') }}
|
||||
|
||||
@ -18,7 +18,7 @@ SELECT
|
||||
['action_id_social']
|
||||
) }}
|
||||
) AS fact_posts_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver_social__posts') }}
|
||||
|
||||
@ -17,7 +17,7 @@ SELECT
|
||||
['action_id_profile']
|
||||
) }}
|
||||
) AS fact_profile_changes_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver_social__profile_changes') }}
|
||||
|
||||
@ -21,7 +21,7 @@ SELECT
|
||||
['action_id_social']
|
||||
) }}
|
||||
) AS fact_widget_deployments_id,
|
||||
inserted_timestamp,
|
||||
modified_timestamp
|
||||
COALESCE(inserted_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS inserted_timestamp,
|
||||
COALESCE(modified_timestamp,'2000-01-01' :: TIMESTAMP_NTZ) AS modified_timestamp
|
||||
FROM
|
||||
{{ ref('silver_social__widgets') }}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user