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
In the ES Sink we use two different clients based on the target instance of elastic. With ES 7 the opensearch high level client is used and against ES 8 the newest Java client is used.
With stripNulls=false, when sending json with null fields the first one correctly send the json keeping the field equals to null. The Java client instead drop the null fields during the payload serialization.
This is useful for end users because Elastic let you to configure null_field for fields in order to be able to query the index checking for nulls.
In any case, the usage of the client should be transparent to the user and it must behaves in the same way.
Configure the json mapper to retain null fields at client level.
Note that the decision to keep or strip null fields is up to the sink itself with the option stripNulls. Therefore the client must be configured to always keep nulls.
Upgraded ES docker images to the latest ones (8.5.1 and 7.17.7)
@liangyepianzhou@Technoboy@nicoloboschi - Can you please tell me why this was NOT cherrypicked to 2.10? We are seeing errors in our ESSink integration tests on the 2.10 branch and it looks like this could be the cause.
@dave2wave There is not ElasticSearchJavaRestClient.java class in 2.10 branch, so the modification for ElasticSearchJavaRestClient.java class should not be cherry-picked to 2.10 branch, right?
@dave2wave There is not ElasticSearchJavaRestClient.java class in 2.10 branch, so the modification for ElasticSearchJavaRestClient.java class should not be cherry-picked to 2.10 branch, right?
Exactly. Branch 2.10 doesn't contain the new java client introduced in #14805
@nicoloboschi Should we cherry-pick the PR #14805 and associated? Or just say that ES8 is not supported in 2.10, but is in 2.9, 2.11, and 3.0?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In the ES Sink we use two different clients based on the target instance of elastic. With ES 7 the opensearch high level client is used and against ES 8 the newest Java client is used.
With
stripNulls=false, when sending json with null fields the first one correctly send the json keeping the field equals to null. The Java client instead drop the null fields during the payload serialization.This is useful for end users because Elastic let you to configure null_field for fields in order to be able to query the index checking for nulls.
In any case, the usage of the client should be transparent to the user and it must behaves in the same way.
Modifications
Note that the decision to keep or strip null fields is up to the sink itself with the option
stripNulls. Therefore the client must be configured to always keep nulls.Documentation
docdoc-requireddoc-not-neededdoc-complete