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.
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-16362: Fix type-unsafety in KStreamKStreamJoin caused by isLeftSide #15601
KAFKA-16362: Fix type-unsafety in KStreamKStreamJoin caused by isLeftSide #15601
Changes from 21 commits
0e3cf15
e29a702
7699acb
bdf8d2c
0a9714d
7da135b
08d38a0
c6b734d
333ddcb
0539964
7c61118
d32425a
76c1e76
0880ec5
df620ed
b1f2d7a
a082cb3
aa6ac4c
e434c66
9727220
9e309a2
b6a9097
46ba0a6
b8ceac0
0dfee4f
e223f33
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I do not get the difference between
VL
andVThis
as well asVR
andVOther
. Could you please elaborate?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.
Also a better name for
VL
andVR
would beVLeft
andVRight
, respectively.VR
is sometimes used for result value type.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.
We needed a way to detect the type of the side being called dynamically so that the super class can handle them based on the caller. This also ensures type safety.
When this class is called by the left side of the join
VThis
would be left left type (VLeft
) andVOther
would be right type (VRight
).Whereas for the right side of the join
VThis
would be right left type (VRight
) andVOther
would be left type (VLeft
).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.
It is more tangible if we look at the abstract methods:
Depending on which join side implements these methods,
VThis
andVOther
can change. For instance, thegetThisValue()
method on the left side of the join would be:Respectively, on the right side we have
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.
Just to throw my own explanation in here:
VLeft and VRight are "absolute" in that they are the left and right types of the overall join. Both sides of the join have equivalent VLeft and VRight types, because they share a common outerJoinStore instance.
VThis and VOther are "relative" in that they are the type of records entering "this" side of the join, and the "other" side of the join, and this is necessarily swapped for the other side of the join.
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.
Do you mean that this is the left side of the join or that this is a left join? That is a bit confusing. Maybe a better name might be
KStreamKStreamJoinLeftSide
.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.
Good catch. What do you think about
KStreamKStreamLeftJoinSide
instead?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.
I would still prefer
KStreamKStreamJoinLeftSide
. It is the left side of a stream-stream join. The processor are also namedKStreamKStreamJoinLeftProcessor
.