-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][io] ElasticSearch sink: align null fields behaviour #18577
Conversation
65b21c3
to
3bb99f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #18577 +/- ##
============================================
- Coverage 47.39% 47.04% -0.35%
+ Complexity 10479 10415 -64
============================================
Files 698 698
Lines 68070 68070
Branches 7279 7279
============================================
- Hits 32264 32026 -238
- Misses 32228 32474 +246
+ Partials 3578 3570 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. One comment inline.
@@ -39,10 +39,10 @@ | |||
public abstract class ElasticSearchTestBase { | |||
|
|||
public static final String ELASTICSEARCH_8 = Optional.ofNullable(System.getenv("ELASTICSEARCH_IMAGE_V8")) | |||
.orElse("docker.elastic.co/elasticsearch/elasticsearch:8.1.0"); | |||
.orElse("docker.elastic.co/elasticsearch/elasticsearch:8.5.1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8.5.2 in pom.xml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the server. https://hub.docker.com/_/elasticsearch/tags
8.5.1 is the latest 8.x
@nicoloboschi Could you please help open a PR to cherry-pick this to branch-2.10 (To avoid including more bugs)? |
I will move this to 2.10.4. If you have any questions, feel free to ping me. |
@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 |
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? |
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
doc
doc-required
doc-not-needed
doc-complete