What happened?
Hi there π
PRQL generates an invalid clause for Snowflake dialect.
According to Snowflake's documentation, the ROW_NUMBER always needs the ORDER BY, which is missing in current generated SQL.
Currently the following error occurs:
Window function type [ROW_NUMBER] requires ORDER BY in window specification.
PRQL input
from invoices
group { this.`customer_id` } (take 1)
SQL output
WITH table_0 AS (
SELECT
*,
ROW_NUMBER() OVER (PARTITION BY customer_id) AS _expr_0
FROM
invoices
)
SELECT
*
FROM
table_0
WHERE
_expr_0 <= 1
Expected SQL output
MVCE confirmation
Anything else?
No response