Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3715#discussion_r116273281
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/ProcTimeInnerJoin.scala
---
@@ -298,16 +289,17 @@ class ProcTimeInnerJoin(
while (keyIter.hasNext && nextTimer == 0) {
val curTime = keyIter.next
if (curTime < expiredTime) {
- expiredList.add(curTime)
+ listToRemove.add(curTime)
} else {
nextTimer = curTime
}
}
- var i = 0
- while (i < expiredList.size) {
- rowMapState.remove(expiredList.get(i))
- i += 1
+ var i = listToRemove.size() - 1
+ while (i >= 0) {
+ rowMapState.remove(listToRemove.get(i))
+ listToRemove.remove(i)
--- End diff --
I think it's even more efficient to traverse the `listToRemove` without
modifying it and calling `listToRemove.clear()` afterwards.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---