gnosis-models/macros/streamline/get_base_table_udtf.sql
Ryan-Loofy 1e70e933ab
Stream 107/stream 108/stream 109/streamline gnosis pipelines (#55)
* Gnosis streamline

* Update loads

* Update xxx
2023-08-02 17:10:49 -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 %}