apache / apache/datafusion-sqlparser-rs
Support `WITH ORDINALITY` in PostgreSQL parsing
- Dominant language
- Rust
- Stars
- 3.5k
- Forks
- 772
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 17
Description
`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)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the PostgreSQL parser path for set-returning functions in a FROM clause and inspect nearby syntax coverage. Use the issue's unnest example as the parsing case, then verify that the WITH ORDINALITY suffix is accepted and represented correctly by the parser.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, rust, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100