Hey Olaf, COLUMNS(*) doesn't pass all your columns as one value into list_value. Instead, DuckDB copies the whole expression around it once for each column. So your query is actually running like this:
SELECT list_sum(list_value(col1)) AS total_sum,
list_sum(list_value(col2)) AS total_sum
FROM (SELECT 1, 2)Each column gets its own copy, which is why you see two columns in the result, with values 1 and 2.
To make list_value take all the columns at once, add a * in front of COLUMNS(*)
SELECT list_sum(list_value(*COLUMNS(*))) AS total_sum FROM (SELECT 1, 2);
* tells DuckDB to put all the columns inside this function call, instead of repeating the expression for each column.
Let me know if this makes sense and if you have any other questions!