-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[ML] Make datafeeds work with nanosecond time fields #51180
Conversation
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.)
Pinging @elastic/ml-core (:ml) |
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
x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/extractor/TimeFieldTests.java
Outdated
Show resolved
Hide resolved
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.
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.
LGTM2
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 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