Open cottrell opened 1 month ago
Sorry for being slow, but could you explain in a bit more detail what the issue is?
(An expected SQL output would be great)
Sorry for being slow, but could you explain in a bit more detail what the issue is?
(An expected SQL output would be great)
If you look at the last row it is "53 " and it shoudl be " 53". I should have chosen a better text than "*" I guess as it doesn't jump out.
If it's possible, prql should probably inspect the columns and align them but if the column names are no available (select * clause) then it is not possible.
I think the simplest solution would be to simply warn in the docs for append that the user must manually align the tables.
WITH "A" AS (
SELECT
billing_country,
COUNT(DISTINCT billing_city) AS a
FROM
invoices
GROUP BY
billing_country
),
table_0 AS (
SELECT
COUNT(DISTINCT billing_city) AS a
FROM
invoices
),
"B" AS (
SELECT
'*' AS billing_country, -- Ensure this column matches the first query
a
FROM
table_0
)
SELECT
billing_country,
a
FROM
"A"
UNION ALL
SELECT
billing_country,
a
FROM
"B";
What happened?
I'm not sure if this is intentional or not.
PRQL input
SQL output
Expected SQL output
No response
MVCE confirmation
Anything else?
It works if you manually align the columns with a select. Might be intended not sure.