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

[BUG] Dynamic Mapping interprets "1406-21" as a [date] field. #9635

Open
ungeordnet opened this issue Aug 30, 2023 · 2 comments
Open

[BUG] Dynamic Mapping interprets "1406-21" as a [date] field. #9635

ungeordnet opened this issue Aug 30, 2023 · 2 comments
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing

Comments

@ungeordnet
Copy link

ungeordnet commented Aug 30, 2023

Describe the bug
Dynamic mapping interprets a string with this format 1406-21 as a date field, but then it fails to index due to 21 not being a valid month.

To Reproduce
Steps to reproduce the behavior:
1.

PUT /bug_report
POST /bugreport/_doc
{
  "not_a_date": "1406-21"
}
{
  "error": {
    "root_cause": [
      {
        "type": "date_time_exception",
        "reason": "date_time_exception: Invalid value for MonthOfYear (valid values 1 - 12): 21"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse field [not_a_date] of type [date] in document with id 'ikxsRYoBwHActdbCw803'. Preview of field's value: '1406-21'",
    "caused_by": {
      "type": "date_time_exception",
      "reason": "date_time_exception: Invalid value for MonthOfYear (valid values 1 - 12): 21"
    }
  },
  "status": 400
}

Expected behavior
The insert of the new document succeeds

Host/Environment (please complete the following information):

  • OpenSearch Version: OpenSearch 2.5
@ungeordnet ungeordnet added bug Something isn't working untriaged labels Aug 30, 2023
@kotwanikunal kotwanikunal added the Indexing Indexing, Bulk Indexing and anything related to indexing label Sep 19, 2023
@ungeordnet
Copy link
Author

Any updates on that issue?

@dblock
Copy link
Member

dblock commented Jul 29, 2024

@ungeordnet I don't think anyone is working on this. Want to try to help? Start by writing a YAML REST test and then a lower level unit test that reproduces the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing
Projects
None yet
Development

No branches or pull requests

4 participants