-
Notifications
You must be signed in to change notification settings - Fork 247
Closed
Labels
bugInvalid compiler output or panicInvalid compiler output or panic
Description
What happened?
PRQL compiler version:0.9.2
I found some related discussions in #2057. But some databases (such as Postgres, DuckDB, and Clickhouse) do not support a select clause to include a column that is not used in an aggregate function without a group by clause.
Error message from duckdb: Binder Error: column c0 must appear in the GROUP BY clause or be used in an aggregate function. Either add it to the GROUP BY list, or use "ANY_VALUE(c0)" if the exact value of "c0" is not important.
PRQL input
prql target:sql.duckdb
from tb1
sort {c0}
aggregate {new_col = min c1}SQL output
WITH table_0 AS (
SELECT
MIN(c1) AS new_col,
c0
FROM
tb1
)
SELECT
new_col
FROM
table_0Expected SQL output
WITH table_0 AS (
SELECT
MIN(c1) AS new_col
FROM
tb1
)
SELECT
new_col
FROM
table_0MVCE confirmation
- Minimal example
- New issue
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bugInvalid compiler output or panicInvalid compiler output or panic