mirror of
https://github.com/FlipsideCrypto/sei-models.git
synced 2026-02-06 13:57:17 +00:00
* Sei txs, blocks, tx count pipeline * Streamline sei pipelines - XXX will be deleted with PROD deployment after approvals - Temp file will be deleted after UDFs are created * Add requirement and update block_number to block_id * Switch to block number * Remove old sources * Update loads and run times * Add prod integration
27 lines
441 B
SQL
27 lines
441 B
SQL
{{ config (
|
|
materialized = "ephemeral",
|
|
unique_key = "block_id",
|
|
) }}
|
|
|
|
WITH base AS (
|
|
|
|
SELECT
|
|
block_timestamp :: DATE AS block_date,
|
|
MAX(block_id) as block_number
|
|
FROM
|
|
{{ ref("silver__blocks") }}
|
|
GROUP BY
|
|
block_timestamp :: DATE
|
|
)
|
|
SELECT
|
|
block_date,
|
|
block_number
|
|
FROM
|
|
base
|
|
WHERE
|
|
block_date <> (
|
|
SELECT
|
|
MAX(block_date)
|
|
FROM
|
|
base
|
|
) |