Skip to content

Redshift interval literals seem to fail to parse #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maxcountryman opened this issue Jun 1, 2020 · 3 comments · Fixed by #184
Closed

Redshift interval literals seem to fail to parse #177

maxcountryman opened this issue Jun 1, 2020 · 3 comments · Fixed by #184
Labels
help wanted Extra attention is needed

Comments

@maxcountryman
Copy link
Contributor

Redshift's interval literals seem to differ in structure from what the parser presently expects. Notably, the date/time field is part of the preceding string. Perhaps the interval implementation could be modified to consider the Redshift implementation?

@nickolay
Copy link
Contributor

nickolay commented Jun 1, 2020

This was intentional limitation of the initial implementation and there's a note to that effect in parser.rs. I don't see a reason why we can't change the parser to accept INTERVAL 'value' not followed by YEAR/HOUR/etc.

(I'm curious how Redshift parses select INTERVAL '1 day' DAY.)

@nickolay nickolay added the help wanted Extra attention is needed label Jun 1, 2020
@maxcountryman
Copy link
Contributor Author

I'd be happy to take a look at this, @nickolay.

@nickolay
Copy link
Contributor

nickolay commented Jun 2, 2020

@maxcountryman That's great to hear! And I will be happy to merge a PR from you:)

maxcountryman added a commit to maxcountryman/sqlparser-rs that referenced this issue Jun 5, 2020
This patch updates our INTERVAL implementation such that the Postgres
and Redshfit variation of the syntax is supported: namely that leading
field is optional.

Fixes apache#177.
maxcountryman added a commit to maxcountryman/sqlparser-rs that referenced this issue Jun 8, 2020
This patch updates our INTERVAL implementation such that the Postgres
and Redshfit variation of the syntax is supported: namely that leading
field is optional.

Fixes apache#177.
nickolay pushed a commit that referenced this issue Jun 10, 2020
Alter INTERVAL to support postgres syntax

This patch updates our INTERVAL implementation such that the Postgres
and Redshfit variation of the syntax is supported: namely that 'leading
field' is optional.

Fixes #177.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants