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:
tarikceric 2023-11-10 12:59:21 -08:00 committed by GitHub
parent 7892ce4ad2
commit 95e392d5b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
88 changed files with 177 additions and 47 deletions

View File

@ -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"

View 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

View File

@ -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 workflow_name workflow_schedule
2 dbt_run_incremental 1,16,31,46 * * * *
3 dbt_run_incremental_non_core 25,50 * * * *
4 dbt_test_tasks 0,30 * * * *

View File

@ -1,7 +1,8 @@
{{ config(
materialized = 'incremental',
unique_key = 'test_timestamp',
full_refresh = false
full_refresh = false,
tags = ['scheduled_non_core']
) }}
WITH source AS (

View File

@ -1,7 +1,8 @@
{{ config(
materialized = 'incremental',
unique_key = 'block_id',
full_refresh = false
full_refresh = false,
tags = ['scheduled_non_core']
) }}
WITH base as (

View File

@ -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 (

View File

@ -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 (

View File

@ -3,6 +3,7 @@
unique_key = "tx_id",
incremental_strategy = 'delete+insert',
cluster_by = ['block_timestamp::DATE'],
tags = ['scheduled_non_core']
) }}
WITH base AS (

View File

@ -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 (

View File

@ -2,6 +2,7 @@
materialized = 'incremental',
unique_key = "tx_id",
incremental_strategy = 'delete+insert',
tags = ['scheduled_non_core']
) }}
WITH post_token_balances AS (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -1,7 +1,7 @@
{{ config(
materialized = 'incremental',
unique_key = "program_id",
tags = ['idls']
tags = ['idls','scheduled_non_core']
) }}
WITH user_abis AS (

View File

@ -1,7 +1,7 @@
{{ config (
materialized = "incremental",
unique_key = "id",
tags = ['idls']
tags = ['idls','scheduled_non_core']
) }}
WITH base AS (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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(

View File

@ -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(

View File

@ -1,5 +1,6 @@
{{ config(
materialized = 'view'
materialized = 'view',
tags = ['scheduled_non_core']
) }}
with base as (

View File

@ -1,5 +1,6 @@
{{ config(
materialized = 'view'
materialized = 'view',
tags = ['scheduled_non_core']
) }}
with base as (

View File

@ -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(

View File

@ -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(

View File

@ -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(

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -1,7 +1,8 @@
{{ config(
materialized = 'incremental',
unique_key = "token_address",
incremental_strategy = 'merge'
incremental_strategy = 'merge',
tags = ['scheduled_non_core']
) }}
WITH base AS (

View File

@ -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 (

View File

@ -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 (

View File

@ -2,6 +2,7 @@
materialized = 'incremental',
unique_key = "tx_id",
incremental_strategy = 'delete+insert',
tags = ['scheduled_non_core']
) }}
WITH offchain AS (

View File

@ -2,6 +2,7 @@
materialized = 'incremental',
unique_key = "tx_id",
incremental_strategy = 'delete+insert',
tags = ['scheduled_non_core']
) }}
WITH bgum_mints AS (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -5,6 +5,7 @@
cluster_by = ['block_timestamp::DATE'],
full_refresh = false,
enabled = false,
tags = ['scheduled_non_core']
) }}
WITH sales_inner_instructions AS (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -3,6 +3,7 @@
unique_key = "tx_id",
incremental_strategy = 'delete+insert',
cluster_by = ['block_timestamp::DATE'],
tags = ['scheduled_non_core']
) }}
WITH txs AS (

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -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

View File

@ -3,6 +3,7 @@
unique_key = "_unique_key",
incremental_strategy = 'merge',
cluster_by = ['recorded_hour::DATE'],
tags = ['scheduled_non_core']
) }}
WITH date_hours AS (

View File

@ -3,6 +3,7 @@
unique_key = "_unique_key",
incremental_strategy = 'merge',
cluster_by = ['recorded_hour::DATE'],
tags = ['scheduled_non_core']
) }}
WITH date_hours AS (

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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() %}

View File

@ -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 (

View File

@ -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 (

View File

@ -3,6 +3,7 @@
unique_key = "CONCAT_WS('-', tx_id, event_index)",
incremental_strategy = 'delete+insert',
cluster_by = ['program_id'],
tags = ['scheduled_core']
) }}
SELECT

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -3,6 +3,7 @@
unique_key = "block_id",
incremental_strategy = 'delete+insert',
cluster_by = ['block_timestamp::DATE'],
tags = ['scheduled_non_core']
) }}
WITH v AS (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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(

View File

@ -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(

View File

@ -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 (

View File

@ -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(

View File

@ -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(

View File

@ -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 (

View File

@ -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 (

View File

@ -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

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (

View File

@ -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 (