mirror of
https://github.com/FlipsideCrypto/aurora-models.git
synced 2026-02-06 14:16:47 +00:00
23 lines
488 B
PL/PgSQL
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 => 500000000))
|
|
)
|
|
SELECT
|
|
id AS height
|
|
FROM
|
|
base
|
|
WHERE
|
|
id <= max_height $$;
|
|
{% endmacro %}
|