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

KAFKA-165: Add change.stream.show.expanded.events property #172

Merged
merged 8 commits into from
Jan 17, 2025

Conversation

Calvinnix
Copy link
Collaborator

No description provided.

@Calvinnix Calvinnix requested a review from arahmanan January 14, 2025 23:04
@@ -148,7 +153,7 @@ void testMissingChangeEventData() {
new SinkDocument(
null,
BsonDocument.parse(
"{documentKey: {}, updateDescription: {updatedFields: 1}}")))),
"{documentKey: {}, updateDescription: {updatedFields: 1, removedFields: []}}")))),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[q] what's the reason for changing this test?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you were to adjust updatedFields to a valid value, the test would still fail because removedFields is a required field. This more closely matches the expected behavior of validating updatedFields instead of failing due to another reason.

@Calvinnix Calvinnix requested a review from arahmanan January 15, 2025 21:57
Copy link
Collaborator

@arahmanan arahmanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just some optional comments/questions

@@ -135,6 +136,10 @@ public boolean isAtLeastSixDotZero() {
return getMaxWireVersion() >= SIX_DOT_ZERO_WIRE_VERSION;
}

public boolean isAtLeastSevenDotZero() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[q] thoughts on adding integration tests against different major versions? It looks like we're missing 6 and 7.
This can be done as part of a separate ticket.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a good idea, I added this ticket to the backlog.

Struct update = (Struct) records.get(1).value();
assertEquals(OperationType.UPDATE.getValue(), update.getString("operationType"));
Struct updateDescription = (Struct) update.get("updateDescription");
assertEquals("{}", updateDescription.getString("disambiguatedPaths"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might have already mentioned this offline, but why aren't we checking that it contains the expected fields similar to this example?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah this is because I wasn't able to produce disambiguatedPaths results because trying to update a field with a . just updates the nested structure instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to take another look at this to make sure I wasn't missing something obvious 😄

@Calvinnix Calvinnix merged commit c623ec0 into mongodb:master Jan 17, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants