-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Dates stored in milliseconds can be passed with higher resolution losing precision #37962
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
Comments
Pinging @elastic/es-search |
I think this should be a failure, not a warning. Could we detect this in the DateFieldMapper.parseCreateField method, checking nano seconds % 1000 equals 0? |
We discussed this issue internally and agreed that an error should be raised. However we are concerned by the bwc of this change and more particularly by the impact that the deprecation could have. It is allowed in 6x to send a date that contains a microseconds part by default so we'd need to log a deprecation warning in this version (and for all indices created in 6x ?) for each document that contains a deprecated format. This could slow down the indexing considerably so we agreed to document the limitation first. There is no way currently to group deprecation warning issued by different documents so we need to think of a better way to deprecate this kind of behavior. |
Pinging @elastic/es-core-infra |
[docs issue triage] |
I'm labeling this |
we discussed this during core-infra sync on 17th March and concluded that we would like to work on this. |
When storing nanoseconds on a date field the nanosecond part is lost as it cannot be stored. The date_nanos field should be used instead. This commit emits a deprecation warning to notify users about this. closes #37962
When storing nanoseconds on a date field the nanosecond part is lost as it cannot be stored. The date_nanos field should be used instead. This commit emits a deprecation warning to notify users about this. closes elastic#37962
reopening as the change was only deprecated for now |
This deprecation ended up affecting other components in our stack (beats) and we decided that this is too late to include this in 8.0 release. Hence it was reverted. |
This reverts commit d50c9e8. relates #78921 reason #37962 (comment)
…stic#79914) This reverts commit d50c9e8. relates elastic#78921 reason elastic#37962 (comment)
It's too late for 9 now, but we should keep it and remember to do something in time for 10 (and/or do any preparation work on the issues mentioned by pgomulka) |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
During the joda to java-time switch we discovered that dates can have a higher resolution, that the implementation is able to store without warning the user about this.
Having a
date
field allows to send a date like2018-10-03T14:42:44.613469+0000
to Elasticsearch. This date however will not store the469
microsecond part, but silently discard it.We should discuss, if we want to do anything about this like emitting a warning.
The text was updated successfully, but these errors were encountered: