sei-models/macros/streamline/get_base_table_udft.sql
Ryan-Loofy 1cfa0d3b5e
Sei txs, blocks, tx count pipeline (#2)
* 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
2023-08-29 12:26:28 -04:00

24 lines
457 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 => 100000000))
)
select
id as height
from
base
where
id <= max_height
$$
;
{% endmacro %}