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

Date properties millisecond precision parsing changed in 7.x #40403

Closed
Mpdreamz opened this issue Mar 25, 2019 · 1 comment · Fixed by #40676
Closed

Date properties millisecond precision parsing changed in 7.x #40403

Mpdreamz opened this issue Mar 25, 2019 · 1 comment · Fixed by #40676
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@Mpdreamz
Copy link
Member

Given the following index:

PUT /index
{
  "mappings": {
    "properties": {
      "timestamp" : {
        "type" : "date"
      }
    }
  }
}

Indexing milliseconds qualified with three digits works.

PUT /index/_doc/1
{
  "timestamp" : "2019-03-19T16:23:09.555"
}

However using two it will fail:

PUT /index/_doc/1
{
  "timestamp" : "2019-03-19T16:23:09.55"
}
{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse field [timestamp] of type [date] in document with id '1'"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse field [timestamp] of type [date] in document with id '1'",
    "caused_by": {
      "type": "illegal_argument_exception",
      "reason": "failed to parse date field [2019-03-19T16:23:09.55] with format [strict_date_optional_time||epoch_millis]",
      "caused_by": {
        "type": "date_time_parse_exception",
        "reason": "Text '2019-03-19T16:23:09.55' could not be parsed, unparsed text found at index 19"
      }
    }
  },
  "status": 400
}

Specifying less then 3 digits for milliseconds worked in previous Elasticsearch versions so this is breaking change.

@jimczi jimczi added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Mar 25, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

spinscale added a commit to spinscale/elasticsearch that referenced this issue Apr 1, 2019
In order to remain compatible with the existing joda based
implementation the parsing of milliseconds should support parsing single
digits instead of relying on three, even with strict formats.

This adds a few tests to duel against the existing joda based
implementation in order to ensure the parsing behaviour is the same.

Closes elastic#40403
spinscale added a commit that referenced this issue Apr 2, 2019
In order to remain compatible with the existing joda based
implementation the parsing of milliseconds should support parsing single
digits instead of relying on three, even with strict formats.

This adds a few tests to duel against the existing joda based
implementation in order to ensure the parsing behaviour is the same.

Closes #40403
spinscale added a commit that referenced this issue Apr 2, 2019
In order to remain compatible with the existing joda based
implementation the parsing of milliseconds should support parsing single
digits instead of relying on three, even with strict formats.

This adds a few tests to duel against the existing joda based
implementation in order to ensure the parsing behaviour is the same.

Closes #40403
spinscale added a commit that referenced this issue Apr 2, 2019
In order to remain compatible with the existing joda based
implementation the parsing of milliseconds should support parsing single
digits instead of relying on three, even with strict formats.

This adds a few tests to duel against the existing joda based
implementation in order to ensure the parsing behaviour is the same.

Closes #40403
spinscale added a commit to spinscale/elasticsearch that referenced this issue Apr 2, 2019
In order to remain compatible with the existing joda based
implementation the parsing of milliseconds should support parsing single
digits instead of relying on three, even with strict formats.

This adds a few tests to duel against the existing joda based
implementation in order to ensure the parsing behaviour is the same.

Closes elastic#40403
spinscale added a commit that referenced this issue Apr 9, 2019
In order to remain compatible with the existing joda based
implementation the parsing of milliseconds should support parsing single
digits instead of relying on three, even with strict formats.

This adds a few tests to duel against the existing joda based
implementation in order to ensure the parsing behaviour is the same.

Closes #40403
gurkankaymak pushed a commit to gurkankaymak/elasticsearch that referenced this issue May 27, 2019
In order to remain compatible with the existing joda based
implementation the parsing of milliseconds should support parsing single
digits instead of relying on three, even with strict formats.

This adds a few tests to duel against the existing joda based
implementation in order to ensure the parsing behaviour is the same.

Closes elastic#40403
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants