apache / apache/datafusion-sqlparser-rs
Support defining windowing behavior in the WINDOW clause
未关闭
- 主要语言
- 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