-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[BUG] Simulate ingest pipeline API throws illegal_argument_exception if remove processor is used #11604
Copy link
Copy link
Closed
Labels
IndexingIndexing, Bulk Indexing and anything related to indexingIndexing, Bulk Indexing and anything related to indexingbugSomething isn't workingSomething isn't workingv2.12.0Issues and PRs related to version 2.12.0Issues and PRs related to version 2.12.0v3.0.0Issues and PRs related to version 3.0.0Issues and PRs related to version 3.0.0
Description
Describe the bug
When calling simulate ingest pipeline API, if the remove processor is used and the metadata field _version_type is not specified for the document, then the API always throws illegal_argument_exception which is not as expected.
This bug relates to this line which was added in this PR: #10895 :
OpenSearch/modules/ingest-common/src/main/java/org/opensearch/ingest/common/RemoveProcessor.java
Line 91 in 074bc6a
| String versionType = document.getFieldValue(IngestDocument.Metadata.VERSION_TYPE.getFieldName(), String.class); |
I'll open a PR to fix this bug and add some yml test for it.
To Reproduce
Steps to reproduce the behavior:
POST _ingest/pipeline/_simulate
{
"pipeline": {
"processors": [
{
"remove": {
"field": "foo"
}
}
]
},
"docs": [
{
"_source": {
"foo": "bar"
}
}
]
}
Expected behavior
Simulate ingest pipeline API runs well no matter the metadata field _version_type is specified or not.
Host/Environment (please complete the following information):
- OS: [macOS]
- Version [main]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
IndexingIndexing, Bulk Indexing and anything related to indexingIndexing, Bulk Indexing and anything related to indexingbugSomething isn't workingSomething isn't workingv2.12.0Issues and PRs related to version 2.12.0Issues and PRs related to version 2.12.0v3.0.0Issues and PRs related to version 3.0.0Issues and PRs related to version 3.0.0