prql
prql copied to clipboard
Wrong output when tables are used and columns have same name
trafficstars
What happened?
Deriving columns with same name as existing results in confusing or wrong output.
PRQL input
from invoices
derive {
total = invoices.total * 0,
a = invoices.total * 0,
}
into data
from data
select {
total,
data.total,
a
}
SQL output
WITH data AS (
SELECT
*,
total * 0 AS total,
total * 0 AS a
FROM
invoices
)
SELECT
total,
total,
a
FROM
data
-- Generated by PRQL compiler version:0.12.2 (https://prql-lang.org)
Expected SQL output
No response
MVCE confirmation
- [X] Minimal example
- [X] New issue
Anything else?
No response