rm unused udf, add quick note on lake

This commit is contained in:
Jack Forgash 2025-02-12 16:32:24 -07:00
parent fa7c7738bf
commit f1fa5240c6
5 changed files with 10 additions and 33 deletions

View File

@ -1,30 +0,0 @@
-- todo, what if we receive a bad response?
-- ask for backend deployment?
{% macro create_UDF_GET_CHAINHEAD() %}
{% set sql %}
CREATE
OR REPLACE FUNCTION {{ target.database }}.STREAMLINE.UDF_GET_CHAINHEAD(
) returns INTEGER
AS $$
SELECT
{{ target.database }}.live.udf_api(
'POST',
'{Service}',
OBJECT_CONSTRUCT(
'Content-Type', 'application/json'
),
OBJECT_CONSTRUCT(
'jsonrpc', '2.0',
'id', 'Flipside/getChainhead/0.1',
'method', 'status',
'params', OBJECT_CONSTRUCT(
'finality', 'final'
)
),
'Vault/prod/near/quicknode/mainnet'
) :data :result :sync_info :latest_block_height :: INT AS block_id
$$
{% endset %}
{% do run_query(sql) %}
{% endmacro %}

View File

@ -0,0 +1,7 @@
# Near Lake Silver Models
The models in this directory were used to ingest and process the blocks and shards from the Near Lake Indexer.
They are being deprecated as of February 2025 in favor of Streamline 2.
Todo - around 30-60 days after the migration, these models will be deleted and the associated tables likely dropped from Snowflake.

View File

@ -3,7 +3,7 @@
{{ config (
materialized = "incremental",
incremental_strategy = 'merge',
incremental_predicates = ["DBT_INTERNAL_DEST.block_timestamp::DATE >= (select min(block_timestamp::DATE-7 ) from " ~ generate_tmp_view_name(this) ~ ")"],
incremental_predicates = ["DBT_INTERNAL_DEST.block_timestamp::DATE >= (select min(block_timestamp::DATE) from " ~ generate_tmp_view_name(this) ~ ")"],
unique_key = "block_hash",
cluster_by = ['modified_timestamp::DATE','partition_key'],
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(block_hash)",

View File

@ -3,7 +3,7 @@
{{ config (
materialized = "incremental",
incremental_strategy = 'merge',
incremental_predicates = ["DBT_INTERNAL_DEST.block_timestamp::DATE >= (select min(block_timestamp::DATE-7 ) from " ~ generate_tmp_view_name(this) ~ ")"],
incremental_predicates = ["DBT_INTERNAL_DEST.block_timestamp::DATE >= (select min(block_timestamp::DATE) from " ~ generate_tmp_view_name(this) ~ ")"],
unique_key = "chunk_hash",
cluster_by = ['modified_timestamp::DATE','partition_key'],
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(chunk_hash)",

View File

@ -3,7 +3,7 @@
{{ config (
materialized = "incremental",
incremental_strategy = 'merge',
incremental_predicates = ["DBT_INTERNAL_DEST.block_timestamp::DATE >= (select min(block_timestamp::DATE-7 ) from " ~ generate_tmp_view_name(this) ~ ")"],
incremental_predicates = ["DBT_INTERNAL_DEST.block_timestamp::DATE >= (select min(block_timestamp::DATE) from " ~ generate_tmp_view_name(this) ~ ")"],
unique_key = "tx_hash",
cluster_by = ['modified_timestamp::DATE','partition_key'],
post_hook = "ALTER TABLE {{ this }} ADD SEARCH OPTIMIZATION on equality(tx_hash)",