You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The update and upsert actions always pass the full Event to the bulk actions, instead of only passing the part of the Event that is filtered from document_root_key, exclude_keys, include_keys, etc.
For update we are passing the original jsonNode here (
The update API in opensearch-java requires we pass in a JsonNode. So that part is what we need. Perhaps the problem is from where we get the JsonNode. Could we get this from the SerializedDocument object instead?
Also, I think this would be a good opportunity to split this logic into another class. There is too much going on in there. If we had a class responsible for this mapping we could have some really solid unit tests to ensure that the output is what we expect for each case.
Describe the bug
The update and upsert actions always pass the full Event to the bulk actions, instead of only passing the part of the Event that is filtered from
document_root_key
,exclude_keys
,include_keys
, etc.For update we are passing the original jsonNode here (
data-prepper/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSink.java
Line 307 in 979a004
data-prepper/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSink.java
Line 334 in 979a004
To Reproduce
Steps to reproduce the behavior:
Send two items with the following structure and sink config
and the final document in OpenSearch will look like
Expected behavior
The updated document should look like
The text was updated successfully, but these errors were encountered: