Skip to main content

unnest_generate_series

Function unnest_generate_series 

Source
pub fn unnest_generate_series(expr: Expression) -> Result<Expression>
Expand description

Convert TABLE GENERATE_SERIES to UNNEST(GENERATE_SERIES(…)).

Some dialects use GENERATE_SERIES as a table-valued function, while others prefer the UNNEST syntax. This converts:

SELECT * FROM GENERATE_SERIES(1, 10) AS t(n)

To:

SELECT * FROM UNNEST(GENERATE_SERIES(1, 10)) AS _u(n)

Reference: transforms.py:125-135