bsc-models/macros/streamline/get_base_table_udtf.sql
xiuy001 5eb0b64546
An 2760 an 2761 add blocks txs to bsc streamline (#35)
* added the bsc streamline

* updated

* added the streamline models with the github actions

* remove credential

* remove credential

* removed user yaml

* updated profile to prod

* update

* tune the parameters

* tune the parameters

* updated

* updated
2023-03-17 09:41:21 -04:00

23 lines
488 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 %}