-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
SQL: Better handling of number parsing exceptions #33776
Conversation
Add proper exceptions in case the parsing of numbers (too large, invalid format) fails.
Pinging @elastic/es-search-aggs |
|
||
public void testLiteralIntegerInvalid() throws Exception { | ||
ParsingException ex = expectThrows(ParsingException.class, () -> parser.createExpression("123456789098765432101")); | ||
assertEquals(ex.getErrorMessage(), "Cannot parse number [123456789098765432101]"); |
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.
Shouldn't this be a "Number X is too large" situation?
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.
Fixed that - makes the parsing code a bit more ugly but the description is more accurate.
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.
LGTM
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.
LGTM
Add proper exceptions in case the parsing of numbers (too large, invalid
format) fails.
Close #33622