mirror of
https://github.com/FlipsideCrypto/solana-models.git
synced 2026-02-06 13:56:50 +00:00
Update/schedule core tags (#396)
* wip * add schedule tags * use snowflake tasks --------- Co-authored-by: Eric Laurello <eric.laurello@flipsidecrypto.com>
This commit is contained in:
parent
7892ce4ad2
commit
95e392d5b1
2
.github/workflows/dbt_run_incremental.yml
vendored
2
.github/workflows/dbt_run_incremental.yml
vendored
@ -41,5 +41,5 @@ jobs:
|
||||
- name: Run DBT Jobs
|
||||
run: |
|
||||
dbt run-operation run_sp_refresh_external_tables_full
|
||||
dbt run -s "solana_models,./models" --exclude tag:share models/streamline models/silver/silver__daily_signers.sql models/silver/silver__signers.sql models/silver/validator models/silver/_observability models/silver/nfts/silver__nft_compressed_mints_onchain.sql models/silver/nfts/silver__nft_compressed_mints.sql models/gold/core/core__ez_signers.sql tag:helius tag:bronze_api models/github_actions
|
||||
dbt run -s "solana_models,./models" --exclude tag:share models/streamline models/silver/silver__daily_signers.sql models/silver/silver__signers.sql models/silver/validator models/silver/_observability models/silver/nfts/silver__nft_compressed_mints_onchain.sql models/silver/nfts/silver__nft_compressed_mints.sql models/gold/core/core__ez_signers.sql tag:helius tag:bronze_api models/github_actions "solana_model,tag:scheduled_non_core"
|
||||
|
||||
|
||||
46
.github/workflows/dbt_run_incremental_non_core.yml
vendored
Normal file
46
.github/workflows/dbt_run_incremental_non_core.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
name: dbt_run_scheduled_non_core
|
||||
run-name: dbt_run_scheduled_non_core
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# schedule:
|
||||
# # Every hour at minute 20,50 (see https://crontab.guru)
|
||||
# - cron: "20,50 * * * *"
|
||||
|
||||
env:
|
||||
DBT_PROFILES_DIR: "${{ secrets.DBT_PROFILES_DIR }}"
|
||||
|
||||
ACCOUNT: "${{ secrets.ACCOUNT }}"
|
||||
ROLE: "${{ secrets.ROLE }}"
|
||||
USER: "${{ secrets.USER }}"
|
||||
PASSWORD: "${{ secrets.PASSWORD }}"
|
||||
REGION: "${{ secrets.REGION }}"
|
||||
DATABASE: "${{ secrets.DATABASE }}"
|
||||
WAREHOUSE: "${{ secrets.WAREHOUSE }}"
|
||||
SCHEMA: "${{ secrets.SCHEMA }}"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
|
||||
jobs:
|
||||
run_dbt_jobs:
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: workflow_prod
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: "3.7.x"
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
pip3 install dbt-snowflake==${{ secrets.DBT_VERSION }} cli_passthrough requests click
|
||||
dbt deps
|
||||
- name: Run DBT Jobs
|
||||
run: |
|
||||
dbt run-operation run_sp_refresh_external_tables_full
|
||||
dbt run -s tag:scheduled_non_core --exclude tag:share models/streamline models/silver/silver__daily_signers.sql models/silver/silver__signers.sql models/silver/validator models/silver/_observability models/silver/nfts/silver__nft_compressed_mints_onchain.sql models/silver/nfts/silver__nft_compressed_mints.sql models/gold/core/core__ez_signers.sql tag:helius tag:bronze_api models/github_actions
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
workflow_name,workflow_schedule
|
||||
dbt_run_incremental,"1,16,31,46 * * * *"
|
||||
dbt_run_incremental_non_core,"25,50 * * * *"
|
||||
dbt_test_tasks,"0,30 * * * *"
|
||||
|
@ -1,7 +1,8 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = 'test_timestamp',
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH source AS (
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = 'block_id',
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base as (
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = 'test_timestamp',
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH summary_stats AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, voter, gauge)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH all_saber_gauges_events AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "tx_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "tx_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH token_balances AS (
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "tx_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH post_token_balances AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "tx_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH vote_programs AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, voter_nft, proposal)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH marinade_vote_txs AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, index)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH vote_programs AS (
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = "program_id",
|
||||
tags = ['idls']
|
||||
tags = ['idls','scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH user_abis AS (
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{{ config (
|
||||
materialized = "incremental",
|
||||
unique_key = "id",
|
||||
tags = ['idls']
|
||||
tags = ['idls','scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_burn_actions AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
-- Get whirlpool LP burns by finding existing whirlpool mints
|
||||
WITH base_burn_actions AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_burn_actions AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{{ config(
|
||||
materialized = 'view'
|
||||
materialized = 'view',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
with base as (
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
{{ config(
|
||||
materialized = 'view'
|
||||
materialized = 'view',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
with base as (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = ["block_id","tx_id","action_index"],
|
||||
merge_predicates = ["DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from {{ this }}__dbt_tmp))"],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_mint_actions AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_mint_actions AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_mint_actions AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_orca_pool_events AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_transfers AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["block_id","tx_id","index","inner_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_raydium_pool_events AS (
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = "token_address",
|
||||
incremental_strategy = 'merge'
|
||||
incremental_strategy = 'merge',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = "token_address",
|
||||
incremental_strategy = 'merge'
|
||||
incremental_strategy = 'merge',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH cmc_base AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, index, inner_index, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_burn_actions AS (
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "tx_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH offchain AS (
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "tx_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH bgum_mints AS (
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "CONCAT_WS('-', contract_address, token_id)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
incremental_strategy = 'delete+insert',
|
||||
incremental_predicates = ['block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_mint_actions AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', mint, payer, mint_currency)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_candy_machine_events AS (
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = "CONCAT_WS('-', mint, payer, mint_currency)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', mint, payer, mint_currency)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', initialization_tx_id, mint, purchaser, mint_currency)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_mint_actions AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS (
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
full_refresh = false,
|
||||
enabled = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH sales_inner_instructions AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH buys AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH txs AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_table AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "tx_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH txs AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "tx_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_table AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH sales_inner_instructions AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, mint, purchaser)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = ["tx_id", "index" ],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE','program_id'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION"
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "_unique_key",
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['recorded_hour::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH date_hours AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "_unique_key",
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['recorded_hour::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH date_hours AS (
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = ['block_id','tx_id','mapped_instruction_index'],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = ['block_id','tx_id','index'],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = ['block_id','tx_id','index'],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = ['block_id','tx_id','index'],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "block_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date'],
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
{% if is_incremental() %}
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, event_type, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS (
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = "CONCAT_WS('-', signer, b_date)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = 'signer',
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH dates_changed AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, event_index)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['program_id'],
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
SELECT
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE','program_id'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
WITH base_i AS (
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, event_type, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
incremental_predicates = ['block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "signer",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = 'signer'
|
||||
cluster_by = 'signer',
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_min_signers AS (
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = "CONCAT_WS('-', block_id, tx_id, index)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_e AS (
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','block_id','_inserted_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
WITH pre_final AS (
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_core']
|
||||
) }}
|
||||
|
||||
WITH base_transfers_i AS (
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','block_id','_inserted_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
full_refresh = false
|
||||
full_refresh = false,
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH pre_final AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "block_id",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH v AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "_unique_key",
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_stake_pool_events AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "_unique_key",
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "_unique_key",
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_lido_events AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "_unique_key",
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_marinade_stake_events AS (
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
materialized = 'incremental',
|
||||
unique_key = "_unique_key",
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date']
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::date'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_stake_pool_events AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = ["block_id","tx_id","program_id"],
|
||||
incremental_strategy = 'merge',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = ["block_id","tx_id","swap_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION"
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = ["block_id","tx_id","swap_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION"
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
merge_exclude_columns = ["inserted_timestamp"],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
unique_key = ["block_id","tx_id","swap_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION"
|
||||
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION",
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = ["block_id","tx_id","swap_index"],
|
||||
incremental_predicates = ['DBT_INTERNAL_DEST.block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE','_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_events AS(
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', tx_id, index, inner_index, mint)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_burn_actions AS (
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
incremental_strategy = 'delete+insert',
|
||||
incremental_predicates = ['block_timestamp::date >= LEAST(current_date-7,(select min(block_timestamp)::date from ' ~ generate_tmp_view_name(this) ~ '))'],
|
||||
cluster_by = ['block_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base_mint_actions AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', epoch, node_pubkey)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
select
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', epoch_recorded, stake_pubkey)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', epoch_recorded, node_pubkey)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
with base as (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', epoch_recorded, vote_pubkey)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
unique_key = "CONCAT_WS('-', epoch_recorded, vote_pubkey)",
|
||||
incremental_strategy = 'delete+insert',
|
||||
cluster_by = ['_inserted_timestamp::DATE'],
|
||||
tags = ['scheduled_non_core']
|
||||
) }}
|
||||
|
||||
WITH base AS (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user