apache / apache/datafusion-sqlparser-rs

Support defining windowing behavior in the WINDOW clause

未關閉
#760 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
3.5k
分支
772
平均合併
4 天 9 小時
30 天內合併 PR
17

描述

PostgreSQL and SparkSQL support defining the windowing behavior in the WINDOW clause and then referenced in OVER.
This is very useful if the same windowing behavior is wanted for several functions.

For example:

````
SELECT sum(salary) OVER w, avg(salary) OVER w
FROM empsalary
WINDOW w AS (PARTITION BY depname ORDER BY salary DESC);

````

https://www.postgresql.org/docs/15/tutorial-window.html

https://www.postgresql.org/docs/15/sql-expressions.html#SYNTAX-WINDOW-FUNCTIONS

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

首先追蹤 parser 如何處理 WINDOW 和 OVER 語法,並使用 issue 中的 PostgreSQL 範例作為語法參考。定義具名視窗定義和參照所需的解析行為,然後新增測試涵蓋範圍,證明兩個函式都可以重複使用 w,且範例能夠被解析。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
rust
領域
databases
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。