apache / apache/datafusion-sqlparser-rs
MySQL allows integer interval values
- Dominant language
- Rust
- Stars
- 3.5k
- Forks
- 772
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 17
Description
The usual format for an interval is `INTERVAL 'value' unit`, but MySQL allows `'value'` to be an expression that is either a string or a number. For example:
```
SELECT DATE_SUB('2018-05-01',INTERVAL '1' YEAR);
SELECT DATE_SUB('2018-05-01',INTERVAL 1 YEAR);
```
both return `2017-05-01`. Currently, the latter syntax is not supported.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the parser entry point and existing tests for SQL INTERVAL expressions. Compare the supported quoted-value form with MySQL's numeric-value form, then add coverage showing that both examples parse successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- compilers, databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100