Conversation
20a1d47 to
0c9b57f
Compare
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
server/src/main/java/org/elasticsearch/common/time/DateUtils.java
Outdated
Show resolved
Hide resolved
...c/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToLongTests.java
Show resolved
Hide resolved
...test/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/ToStringTests.java
Show resolved
Hide resolved
|
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
|
I think it'd be nice to have a file like |
|
@elasticsearchmachine test this please |
server/src/main/java/org/elasticsearch/common/time/DateUtils.java
Outdated
Show resolved
Hide resolved
|
I'm removing myself as the |
|
💚 CLA has been signed |
cde2dba to
fe1655d
Compare
server/src/main/java/org/elasticsearch/common/time/DateUtils.java
Outdated
Show resolved
Hide resolved
| area: Search | ||
| type: bug | ||
| issues: | ||
| - 112483 |
There was a problem hiding this comment.
I don't think this patch solves issue #112483 though - wouldn't IllegalArgumentException still produce 500? One would have to catch it in DateFieldMapper and convert it to ElasticsearchParseException to make it 4xx if I understand it correctly. Which however raises the question - if we'd have to catch it there, does it really need to be also converted in toLongMillis (not a rhetorical question, I don't have a predetermined answer to it)?
There was a problem hiding this comment.
I totally agree with this point. Now I think, the only use case of this patch can be providing better error message to the user (given that we catch it in DateFieldMapper as well, and convert to ElasticsearchParseException to make it 4xx)
There was a problem hiding this comment.
IllegalArgumentException does normally get converted to a 400 error here: https://github.com/elastic/elasticsearch/blob/main/server/src/main/java/org/elasticsearch/ExceptionsHelper.java#L64 . Any reason why this one specifically would lead to a 500 instead?
There was a problem hiding this comment.
I wasn't aware of this and assumed IllegalArgumentException returns 500 based on previous comment. As that's not the case, I think the patch should work without additonal modification
There was a problem hiding this comment.
Yeah maybe I was confusing it with another exception.
There was a problem hiding this comment.
Do we have a test that verifies this? Don't just believe me :)
There was a problem hiding this comment.
I can't verify the full circle here because the original issue did not contain reproducing example and I am not sure how to reproduce it from scratch. But this suggests @javanna is correct:
so while I'd be more happy if we had full cycle test I think this is ok.|
@elasticmachine test this please |
|
@pulak777 looks like we have some checkstyle problems here, please fix them. Usually just running |
|
done |
|
@elasticmachine test this please |
|
Looks like it breaks some tests, e.g.: |
|
is it possible to grant me access to see the failing tests on ci? it kinda takes forever to run all the tests on my laptop |
|
@pulak777 Not sure about the access, but look at |
|
updated the failing tests in |
|
@elasticmachine test this please |
|
@elasticmachine update branch |
|
@elasticmachine test this please |
|
@elasticmachine update branch |
|
@elasticmachine test this please |
|
Replaced by #124048 to update to current code. |
This makes sure that dates that overflow a
longfail with a reasonable message rather than anArithmeticException. This mostly just hits the field mapper.