-
Notifications
You must be signed in to change notification settings - Fork 433
Open
Labels
Description
Input data
Which SQL and options did you provide as input?
SELECT
some_events.*,
sum(some_events.size) OVER (
ORDER BY time_stamp
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS running_size
FROM
some_events
Expected Output
SELECT
some_events.*,
sum(some_events.size) OVER (
ORDER BY
time_stamp
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS running_size
FROM
some_events
Actual Output
SELECT
some_events.*,
sum(some_events.size) OVER (
ORDER BY
time_stamp ROWS BETWEEN UNBOUNDED PRECEDING
AND CURRENT ROW
) AS running_size
FROM
some_events
Usage
- How are you calling / using the library?
--sql-formatter -l duckdb -c '{"keywordCase": "upper", "dataTypeCase": "upper"}' filename
- What SQL language(s) does this apply to?
-- Tried it on tsql and duckdb - Which SQL Formatter version are you using?
-- 15.6.6
A few examples of how DuckDB's team formats these clauses -
https://duckdb.org/2025/02/10/window-catchup.html
https://duckdb.org/2021/10/13/windowing.html
sql-formatter is great, thank you for the project!