[7.15] [ML] Fix failure on datafeed preview with date_nanos time field (#77109)#77119
Merged
elasticsearchmachine merged 1 commit intoelastic:7.15from Sep 1, 2021
Conversation
…tic#77109) Preview datafeed currently fails when the time field is of type `date_nanos`. The failure contains the error message: ``` date [...] is after 2262-04-11T23:47:16.854775807 and cannot be stored in nanosecond resolution ``` This commit fixes this failure. The cause of the issue was that preview generates a search with a range query on the time field whose upper bound is `Long.MAX_VALUE` in order to include all available data in the preview. However, that value is parsed with `DateUtils.toLong` when the time field is `date_nanos` and it hits the limitation that values can't be larger than `DateUtils.MAX_NANOSECOND_INSTANT`. The fix checks whether the time field is `date_nanos` and uses `DateUtils.MAX_NANOSECOND_INSTANT` as the upper bound instead of `Long.MAX_VALUE`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports the following commits to 7.15: