apache / apache/datafusion-sqlparser-rs

Support `WITH ORDINALITY` in PostgreSQL parsing

未关闭
#967 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
3.5k
派生
772
平均合并
4 天 9 小时
30 天内合并 PR
17

描述

`WITH ORDINALITY` can be used as a suffix for any [set returning function](https://www.postgresql.org/docs/devel/functions-srf.html) in a `FROM` clause to append a new column containing the row's ordinal position. Simple example:

```sql
SELECT * FROM unnest(ARRAY['a', 'b', 'c']) WITH ORDINALITY;
unnest | ordinality
--------+------------
a | 1
b | 2
c | 3
(3 rows)
```

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先定位 PostgreSQL 中 FROM 子句内 set-returning functions 的解析器路径,并检查附近的语法覆盖情况。使用 issue 中的 unnest 示例作为解析案例,然后验证 WITH ORDINALITY 后缀能够被接受,并由解析器正确表示。

由索引模型根据 Issue 内容生成。

评估

技术栈
postgresql, rust, sql
领域
databases
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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