A static site generator for data apps, dashboards, reports, and more. Observable Framework combines JavaScript on the front-end for interactive graphics with any language on the back-end for data analysis.
Not exactly sure where the problem is, so trying here first.
When running a DuckDB window function, the return value of the function is a tuple in Observable Framework:
WITH
data AS (
SELECT 1 AS val
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
ORDER BY val
)
SELECT
val,
sum(val) OVER (
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS cumulative
FROM
data
ORDER BY
val
This query yields:
Casting inside the query does return the right value:
WITH
data AS (
SELECT 1 AS val
UNION ALL SELECT 2
UNION ALL SELECT 3
UNION ALL SELECT 4
UNION ALL SELECT 5
ORDER BY val
)
SELECT
val,
CAST(sum(val) OVER (
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS INTEGER) AS cumulative
FROM
data
ORDER BY
val
Not sure if it's DuckDB or Observable Framework. Would be good if someone could point me in the right direction 👍
Not exactly sure where the problem is, so trying here first.
When running a DuckDB window function, the return value of the function is a tuple in Observable Framework:
This query yields:
Casting inside the query does return the right value:
Not sure if it's DuckDB or Observable Framework. Would be good if someone could point me in the right direction 👍