Skip to content
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

[ML] Make datafeeds work with nanosecond time fields #51180

Merged

Conversation

droberts195
Copy link
Contributor

@droberts195 droberts195 commented Jan 17, 2020

Allows ML datafeeds to work with time fields that have
the "date_nanos" type and make use of the extra precision.
(Previously datafeeds only worked with time fields that were
exact multiples of milliseconds. So datafeeds would work
with "date_nanos" only if the extra precision over "date" was
not used.)

Relates #49889

Allows ML datafeeds to work with time fields that have
the "date_nanos" type.  (Previously datafeeds only
worked with time fields that had the "date" type.)
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (:ml)

Copy link
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

Co-Authored-By: David Kyle <david.kyle@elastic.co>
The extractor for the primary time field of an anomaly
detection job is automatically created as a TimeField
without checking its field caps response, so earlier
changes in this PR did enough to make that scenario
work for "date_nanos" fields.  However, the main field
type detection code was still only accepting "date"
to create a TimeField.  This change makes it accept
either or both of "date" and "date_nanos".
…droberts195/elasticsearch into make_datafeed_work_with_nanosecond_time
Profiling showed the low level version is 3 times faster
and we do time parsing for every single document fed to
a job.
Copy link
Contributor

@przemekwitek przemekwitek 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
Contributor

@dimitris-athanasiou dimitris-athanasiou left a comment

Choose a reason for hiding this comment

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

LGTM2

@droberts195 droberts195 merged commit 3f8071e into elastic:master Jan 21, 2020
@droberts195 droberts195 deleted the make_datafeed_work_with_nanosecond_time branch January 21, 2020 09:58
droberts195 added a commit that referenced this pull request Jan 21, 2020
Allows ML datafeeds to work with time fields that have
the "date_nanos" type _and make use of the extra precision_.
(Previously datafeeds only worked with time fields that were
exact multiples of milliseconds.  So datafeeds would work
with "date_nanos" only if the extra precision over "date" was
not used.)

Relates #49889
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants