apache / apache/datafusion-sqlparser-rs
`Hive` dialect does not support `distribute by` or `sort by` in window specs
- 主要语言
- Rust
- 星标
- 3.5k
- 派生
- 772
- 平均合并
- 4 天 9 小时
- 30 天内合并 PR
- 17
描述
In Hive 3.1.x, we found that the following query executes successfully:
```sql
select row_number() over(distribute by id sort by update_time desc) as row_num
from (select 1 as id, current_timestamp as update_time) t
```
However, when generating the AST using **the latest code from the main branch**, the following error occurs:
Reference documentation:
https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g#L293-L297
https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g#L135-L139
https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g#L271-L27
贡献指南
这个仓库没有索引到贡献指南
调研方向
在 Hive 方言中重现该查询,并跟踪其窗口规范的解析方式。比较 Hive 的 IdentifiersParser.g、SelectClauseParser.g 和 FromClauseParser.g 中的相关语法,然后添加回归覆盖,展示 distribute by 和 sort by 能够被接受且 AST 能够成功生成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust, sql
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 58/100