twalthr commented on a change in pull request #6776: [FLINK-9715][table] Support temporal join with event time URL: https://github.com/apache/flink/pull/6776#discussion_r225543261
########## File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/TemporalRowtimeJoin.scala ########## @@ -237,15 +238,17 @@ class TemporalRowtimeJoin( * be joined with it later */ private def cleanUpState(timerTimestamp: Long, rightRowsSorted: util.List[Row]) = { - for (i <- 0 until firstIndexToKeep(timerTimestamp, rightRowsSorted)) { + var i = 0 + while (i < firstIndexToKeep(timerTimestamp, rightRowsSorted)) { val rightTime = getRightTime(rightRowsSorted.get(i)) rightState.remove(rightTime) + i += 1 } } private def firstIndexToKeep(timerTimestamp: Long, rightRowsSorted: util.List[Row]): Int = { val firstIndexNewerThenTimer = - rightRowsSorted.indexWhere(row => getRightTime(row) > timerTimestamp) + indexOf[Row](rightRowsSorted, row => getRightTime(row) > timerTimestamp) Review comment: Inline the Scala closure into `indexOf`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services