-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Disallow duplicate interval types during parsing #4188
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
Conversation
04d7742 to
e222914
Compare
alamb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me -- thank you @Jefffrey
I had a small suggestion to make the error message more specific, and then this PR needs to be rebased, but otherwise I think it is good to go
cc @waynexia and @waitingkuo
| // Disallow duplicate interval types | ||
| if used_interval_types & (it as u16) != 0 { | ||
| return Err(DataFusionError::SQL(ParserError::ParserError(format!( | ||
| "Invalid input syntax for type interval: {:?}", | ||
| value | ||
| )))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Disallow duplicate interval types | |
| if used_interval_types & (it as u16) != 0 { | |
| return Err(DataFusionError::SQL(ParserError::ParserError(format!( | |
| "Invalid input syntax for type interval: {:?}", | |
| value | |
| )))); | |
| // Disallow duplicate interval types | |
| if used_interval_types & (it as u16) != 0 { | |
| return Err(DataFusionError::SQL(ParserError::ParserError(format!( | |
| "Invalid input syntax for type interval: {:?}. Repeated type {}", | |
| value, interval_type | |
| )))); |
e222914 to
522627b
Compare
waynexia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thanks again @Jefffrey ! |
|
Benchmark runs are scheduled for baseline = b7a33c9 and contender = d52234f. d52234f is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
Which issue does this PR close?
Closes #3183.
Rationale for this change
What changes are included in this PR?
Keep track of interval types found during parsing as bitflag.
Also refactor interval types to use an Enum to better serve above point.
Are these changes tested?
Added unit test.
Are there any user-facing changes?