apache / apache/datafusion-sqlparser-rs

`Hive` dialect does not support `distribute by` or `sort by` in window specs

未关闭
#2,339 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
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
```

Image

Image

However, when generating the AST using **the latest code from the main branch**, the following error occurs:

Image

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

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。