diff --git a/models/bronze/bronze__asset_metadata_api.sql b/models/bronze/bronze__asset_metadata_api.sql index 7df7a99..62f0c9a 100644 --- a/models/bronze/bronze__asset_metadata_api.sql +++ b/models/bronze/bronze__asset_metadata_api.sql @@ -1,5 +1,6 @@ {{ config ( - materialized = 'view' + materialized = 'view', + enabled = false ) }} SELECT diff --git a/models/bronze/bronze__pool_balances_api.sql b/models/bronze/bronze__pool_balances_api.sql index 4bb7996..e7521c9 100644 --- a/models/bronze/bronze__pool_balances_api.sql +++ b/models/bronze/bronze__pool_balances_api.sql @@ -1,5 +1,6 @@ {{ config ( - materialized = 'view' + materialized = 'view', + enabled = false ) }} SELECT diff --git a/models/silver/core/silver__asset_metadata.sql b/models/silver/core/silver__asset_metadata.sql index 5e3018b..590d280 100644 --- a/models/silver/core/silver__asset_metadata.sql +++ b/models/silver/core/silver__asset_metadata.sql @@ -5,42 +5,44 @@ tags = ['daily'] ) }} -WITH base AS ( +WITH {# base AS ( - SELECT - base AS address, - NAME AS label, - symbol AS project_name, - denom_units AS raw_metadata, - '2000-01-01' :: datetime AS _inserted_timestamp - FROM - {{ source( - 'bronze_streamline', - 'asset_metadata_api' - ) }} - GROUP BY - 1, - 2, - 3, - 4 +SELECT + base AS address, + NAME AS label, + symbol AS project_name, + denom_units AS raw_metadata, + '2000-01-01' :: datetime AS _inserted_timestamp +FROM + {{ source( + 'bronze_streamline', + 'asset_metadata_api' + ) }} +GROUP BY + 1, + 2, + 3, + 4 ), +#} combo AS ( - SELECT - address, - label, - project_name, - raw_metadata [0] :aliases [0] :: STRING AS alias, - raw_metadata [array_size(raw_metadata)-1] :exponent :: NUMBER AS DECIMAL, - raw_metadata, - COALESCE( - raw_metadata [0] :aliases [0] :: STRING, - raw_metadata [0] :denom :: STRING - ) AS denom, - address AS _unique_key, - _inserted_timestamp + {# SELECT + address, + label, + project_name, + raw_metadata [0] :aliases [0] :: STRING AS alias, + raw_metadata [array_size(raw_metadata)-1] :exponent :: NUMBER AS DECIMAL, + raw_metadata, + COALESCE( + raw_metadata [0] :aliases [0] :: STRING, + raw_metadata [0] :denom :: STRING + ) AS denom, + address AS _unique_key, + _inserted_timestamp FROM base UNION ALL + #} SELECT COALESCE( VALUE :denom :: STRING, diff --git a/models/silver/defi/silver__pool_balances.sql b/models/silver/defi/silver__pool_balances.sql index a25c98d..956d690 100644 --- a/models/silver/defi/silver__pool_balances.sql +++ b/models/silver/defi/silver__pool_balances.sql @@ -7,23 +7,24 @@ tags = ['noncore'] ) }} -- depends_on: {{ ref('bronze__streamline_pool_balances') }} -WITH base AS ( +WITH {# base AS ( - SELECT - A.block_id, - A.pools, - A._INSERTED_DATE AS _INSERTED_TIMESTAMP - FROM - {{ source( - 'bronze_streamline', - 'pool_balances_api' - ) }} A +SELECT + A.block_id, + A.pools, + A._INSERTED_DATE AS _INSERTED_TIMESTAMP +FROM + {{ source( + 'bronze_streamline', + 'pool_balances_api' + ) }} A {% if is_incremental() %} WHERE 0 = 1 {% endif %} ), +#} sl2 AS ( SELECT VALUE :metadata :request :headers :"x-cosmos-block-height" :: INT AS block_id, @@ -69,7 +70,7 @@ combo AS ( A.pools ) b {# WHERE value_raw :BLOCK_NUMBER IS NULL #} - UNION ALL + {# UNION ALL SELECT block_id, b.value, @@ -78,7 +79,7 @@ combo AS ( base A JOIN LATERAL FLATTEN( A.pools - ) b + ) b #} ) SELECT A.block_id, diff --git a/models/sources.yml b/models/sources.yml index dd96aee..5ea32fd 100644 --- a/models/sources.yml +++ b/models/sources.yml @@ -22,15 +22,15 @@ sources: schema: | {{ "OSMOSIS_DEV" if var("STREAMLINE_USE_DEV_FOR_EXTERNAL_TABLES", False) else "OSMOSIS" }} tables: - - name: validator_metadata_api - - name: asset_metadata_api - - name: balances_api - - name: pool_balances_api - - name: blocks - - name: transactions - - name: txcount - - name: tx_search - - name: pool_balances + # - name: validator_metadata_api + # - name: asset_metadata_api + # - name: balances_api + # - name: pool_balances_api + # - name: blocks + # - name: transactions + # - name: txcount + # - name: tx_search + # - name: pool_balances - name: balances - name: blocks_v2 - name: transactions_v2 diff --git a/models/streamline/bronze/core/bronze__streamline_FR_balances.sql b/models/streamline/bronze/core/bronze__streamline_FR_balances.sql index fbfa853..65901f9 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_balances.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_balances.sql @@ -13,7 +13,7 @@ SELECT inserted_timestamp FROM {{ ref('bronze__streamline_FR_balances_v2') }} -UNION ALL + {# UNION ALL SELECT VALUE, _partition_by_block_id AS partition_key, @@ -23,3 +23,4 @@ SELECT _INSERTED_TIMESTAMP FROM {{ ref('bronze__streamline_FR_balances_v1') }} + #} diff --git a/models/streamline/bronze/core/bronze__streamline_FR_blocks.sql b/models/streamline/bronze/core/bronze__streamline_FR_blocks.sql index 1a14620..65873a9 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_blocks.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_blocks.sql @@ -12,7 +12,7 @@ SELECT inserted_timestamp FROM {{ ref('bronze__streamline_FR_blocks_v2') }} -UNION ALL + {# UNION ALL SELECT VALUE, _partition_by_block_id AS partition_key, @@ -22,3 +22,4 @@ SELECT _INSERTED_TIMESTAMP FROM {{ ref('bronze__streamline_FR_blocks_v1') }} + #} diff --git a/models/streamline/bronze/core/bronze__streamline_FR_blocks_v1.sql b/models/streamline/bronze/core/bronze__streamline_FR_blocks_v1.sql index d066fc5..32b4861 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_blocks_v1.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_blocks_v1.sql @@ -1,5 +1,6 @@ {{ config ( - materialized = 'view' + materialized = 'view', + enabled = false ) }} {{ streamline_external_table_FR_query( "blocks", diff --git a/models/streamline/bronze/core/bronze__streamline_FR_pool_balances.sql b/models/streamline/bronze/core/bronze__streamline_FR_pool_balances.sql index ddcf84b..8f99a12 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_pool_balances.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_pool_balances.sql @@ -12,7 +12,7 @@ SELECT inserted_timestamp FROM {{ ref('bronze__streamline_FR_pool_balances_v2') }} -UNION ALL + {# UNION ALL SELECT VALUE, _partition_by_block_id AS partition_key, @@ -22,3 +22,4 @@ SELECT _INSERTED_TIMESTAMP FROM {{ ref('bronze__streamline_FR_pool_balances_v1') }} + #} diff --git a/models/streamline/bronze/core/bronze__streamline_FR_pool_balances_v1.sql b/models/streamline/bronze/core/bronze__streamline_FR_pool_balances_v1.sql index b4781c3..78cb7f8 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_pool_balances_v1.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_pool_balances_v1.sql @@ -1,6 +1,7 @@ {{ config ( materialized = 'view', - tags = ['core'] + tags = ['core'], + enabled = false ) }} {{ streamline_external_table_FR_query( model = 'pool_balances', diff --git a/models/streamline/bronze/core/bronze__streamline_FR_transactions.sql b/models/streamline/bronze/core/bronze__streamline_FR_transactions.sql index f751fec..2ec12fe 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_transactions.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_transactions.sql @@ -12,7 +12,7 @@ SELECT inserted_timestamp FROM {{ ref('bronze__streamline_FR_transactions_v2') }} -UNION ALL + {# UNION ALL SELECT VALUE, _partition_by_block_id AS partition_key, @@ -22,3 +22,4 @@ SELECT _INSERTED_TIMESTAMP FROM {{ ref('bronze__streamline_FR_transactions_v1') }} + #} diff --git a/models/streamline/bronze/core/bronze__streamline_FR_transactions_old.sql b/models/streamline/bronze/core/bronze__streamline_FR_transactions_old.sql index 9239ce0..9e464a2 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_transactions_old.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_transactions_old.sql @@ -1,6 +1,7 @@ {{ config ( materialized = 'view', - tags = ['core'] + tags = ['core'], + enabled = false ) }} {% set model = this.identifier.split("_") [-1] %} diff --git a/models/streamline/bronze/core/bronze__streamline_FR_transactions_v1.sql b/models/streamline/bronze/core/bronze__streamline_FR_transactions_v1.sql index 3e1e384..12721fe 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_transactions_v1.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_transactions_v1.sql @@ -1,5 +1,6 @@ {{ config ( - materialized = 'view' + materialized = 'view', + enabled = false ) }} {{ streamline_external_table_FR_query( "transactions", diff --git a/models/streamline/bronze/core/bronze__streamline_FR_tx_counts.sql b/models/streamline/bronze/core/bronze__streamline_FR_tx_counts.sql index db9bf0a..823d20c 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_tx_counts.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_tx_counts.sql @@ -12,7 +12,7 @@ SELECT inserted_timestamp FROM {{ ref('bronze__streamline_FR_tx_counts_v2') }} -UNION ALL + {# UNION ALL SELECT VALUE, _partition_by_block_id AS partition_key, @@ -22,3 +22,4 @@ SELECT _INSERTED_TIMESTAMP FROM {{ ref('bronze__streamline_FR_tx_counts_v1') }} + #} diff --git a/models/streamline/bronze/core/bronze__streamline_FR_tx_counts_v1.sql b/models/streamline/bronze/core/bronze__streamline_FR_tx_counts_v1.sql index 26c9b65..37a5b20 100644 --- a/models/streamline/bronze/core/bronze__streamline_FR_tx_counts_v1.sql +++ b/models/streamline/bronze/core/bronze__streamline_FR_tx_counts_v1.sql @@ -1,5 +1,6 @@ {{ config ( - materialized = 'view' + materialized = 'view', + enabled = false ) }} {{ streamline_external_table_FR_query( "txcount",