Skip to content

[ML] Fix failure on datafeed preview with date_nanos time field#77109

Merged
dimitris-athanasiou merged 3 commits intoelastic:masterfrom
dimitris-athanasiou:support-date-nanos-in-datafeed-preview
Sep 1, 2021
Merged

[ML] Fix failure on datafeed preview with date_nanos time field#77109
dimitris-athanasiou merged 3 commits intoelastic:masterfrom
dimitris-athanasiou:support-date-nanos-in-datafeed-preview

Conversation

@dimitris-athanasiou
Copy link
Copy Markdown
Contributor

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.

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`.
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/ml-core (Team:ML)

Copy link
Copy Markdown

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dimitris-athanasiou dimitris-athanasiou merged commit 7afa5e5 into elastic:master Sep 1, 2021
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Sep 1, 2021
…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`.
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Sep 1, 2021
…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`.
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

💚 Backport successful

Status Branch Result
7.15
7.x
7.14

elasticsearchmachine pushed a commit that referenced this pull request Sep 1, 2021
…) (#77121)

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`.
elasticsearchmachine pushed a commit that referenced this pull request Sep 1, 2021
…) (#77119)

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`.
elasticsearchmachine pushed a commit that referenced this pull request Sep 1, 2021
…) (#77120)

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`.
@dimitris-athanasiou dimitris-athanasiou deleted the support-date-nanos-in-datafeed-preview branch September 1, 2021 14:00
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Nov 29, 2021
In elastic#77109 a bug was fixed with regard to `date_nanos` time fields
and the preview datafeed API. However, that fix introduces a new bug.
As we are calling the field caps API to find out whether the time field
is `date_nanos`, we are setting the datafeed indices on the request.
This may result to erroneous behaviour on local indices and it certainly
will result to an error if the datafeed's indices are remote.

This commit fixes that problem by setting the datafeed's indices on the
field caps request.
dimitris-athanasiou added a commit that referenced this pull request Nov 29, 2021
In #77109 a bug was fixed with regard to `date_nanos` time fields
and the preview datafeed API. However, that fix introduces a new bug.
As we are calling the field caps API to find out whether the time field
is `date_nanos`, we are setting the datafeed indices on the request.
This may result to erroneous behaviour on local indices and it certainly
will result to an error if the datafeed's indices are remote.

This commit fixes that problem by setting the datafeed's indices on the
field caps request.
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Nov 29, 2021
In elastic#77109 a bug was fixed with regard to `date_nanos` time fields
and the preview datafeed API. However, that fix introduces a new bug.
As we are calling the field caps API to find out whether the time field
is `date_nanos`, we are setting the datafeed indices on the request.
This may result to erroneous behaviour on local indices and it certainly
will result to an error if the datafeed's indices are remote.

This commit fixes that problem by setting the datafeed's indices on the
field caps request.
dimitris-athanasiou added a commit to dimitris-athanasiou/elasticsearch that referenced this pull request Nov 29, 2021
In elastic#77109 a bug was fixed with regard to `date_nanos` time fields
and the preview datafeed API. However, that fix introduces a new bug.
As we are calling the field caps API to find out whether the time field
is `date_nanos`, we are setting the datafeed indices on the request.
This may result to erroneous behaviour on local indices and it certainly
will result to an error if the datafeed's indices are remote.

This commit fixes that problem by setting the datafeed's indices on the
field caps request.
elasticsearchmachine pushed a commit that referenced this pull request Nov 29, 2021
In #77109 a bug was fixed with regard to `date_nanos` time fields
and the preview datafeed API. However, that fix introduces a new bug.
As we are calling the field caps API to find out whether the time field
is `date_nanos`, we are setting the datafeed indices on the request.
This may result to erroneous behaviour on local indices and it certainly
will result to an error if the datafeed's indices are remote.

This commit fixes that problem by setting the datafeed's indices on the
field caps request.
elasticsearchmachine pushed a commit that referenced this pull request Nov 29, 2021
In #77109 a bug was fixed with regard to `date_nanos` time fields
and the preview datafeed API. However, that fix introduces a new bug.
As we are calling the field caps API to find out whether the time field
is `date_nanos`, we are setting the datafeed indices on the request.
This may result to erroneous behaviour on local indices and it certainly
will result to an error if the datafeed's indices are remote.

This commit fixes that problem by setting the datafeed's indices on the
field caps request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants