Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/5140#discussion_r159695882
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/TimeBoundedStreamJoin.scala
---
@@ -196,35 +181,38 @@ abstract class TimeBoundedStreamJoin(
if (rightTime >= rightQualifiedLowerBound && rightTime <=
rightQualifiedUpperBound) {
val rightRows = rightEntry.getValue
var i = 0
- var markEmitted = false
+ var entryUpdated = false
while (i < rightRows.size) {
- joinCollector.resetThisTurn()
+ joinCollector.reset()
val tuple = rightRows.get(i)
joinFunction.join(leftRow, tuple.f0, joinCollector)
- if (joinType == JoinType.RIGHT_OUTER || joinType ==
JoinType.FULL_OUTER) {
- if (!tuple.f1 && joinCollector.everEmittedThisTurn) {
- // Mark the right row as being successfully joined and
emitted.
- tuple.f1 = true
- markEmitted = true
+ if (joinCollector.emitted) {
--- End diff --
change to
```
emitted = emitted || joinCollector.emitted
if (joinType == JoinType.RIGHT_OUTER || joinType == JoinType.FULL_OUTER) {
if (!tuple.f1 && joinCollector.emitted) {
// Mark the right row as being successfully joined and emitted.
tuple.f1 = true
entryUpdated = true
}
}
```
to avoid a condition for inner and left joins
---