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] Throw class_cast_exception when adding _version field to docs in ingest simulate API #10097

Closed
gaobinlong opened this issue Sep 18, 2023 · 1 comment
Labels
bug Something isn't working Indexing Indexing, Bulk Indexing and anything related to indexing untriaged

Comments

@gaobinlong
Copy link
Collaborator

Describe the bug
When adding _version field to each doc in the request body of ingest simulate API, the API returns class_cast_exception with 500 status code no matter the field is a string or an integer.

To Reproduce
Request:

POST _ingest/pipeline/_simulate
{
  "pipeline" : {
    "description": "test",
    "processors": [
        {
          "set": {
            "field": "foo",
            "value": "zoo"
          }
        }
    ]
  },
  "docs" : [
    {
            "_version" : "123",
            "_source" : {
                "foo" : "bar"
            }
        }
  ]
}

Response:

{
  "error": {
    "root_cause": [
      {
        "type": "class_cast_exception",
        "reason": "class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')"
      }
    ],
    "type": "class_cast_exception",
    "reason": "class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')"
  },
  "status": 500
}

Expected behavior
Ingest simulate API can accept _version field and handle it correctly.

Host/Environment (please complete the following information):

  • OS: [MacOS]
  • Version [OpenSearch 2.9]

Additional context
Add any other context about the problem here.

@gaobinlong
Copy link
Collaborator Author

Closed by #10478.

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 untriaged
Projects
None yet
Development

No branches or pull requests

2 participants