mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 14:06:44 +00:00
* source, bronze, complete, rt views * complete testnet_ dependency * upd sources.yml * upd models and bronze * upd models.sql * upd model in bronze views * adding chainhead_testnet * add jobs * fix: hour * upd api integration * various fixes. useast2, gha workflows, bad refs, etc * update udtf_get_base_table --------- Co-authored-by: WHYTEWYLL <juanmiblanco1@gmail.com>
23 lines
462 B
PL/PgSQL
23 lines
462 B
PL/PgSQL
{% macro create_udtf_get_base_table(schema) %}
|
|
create or replace function {{ schema }}.udtf_get_base_table(max_height integer)
|
|
returns table (height number)
|
|
as
|
|
$$
|
|
with base as (
|
|
select
|
|
row_number() over (
|
|
order by
|
|
seq4()
|
|
) as id
|
|
from
|
|
table(generator(rowcount => 1000000000))
|
|
)
|
|
select
|
|
id as height
|
|
from
|
|
base
|
|
where
|
|
height <= max_height
|
|
$$
|
|
;
|
|
{% endmacro %} |