pnowojski 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_r225970725
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/join/TemporalRowtimeJoin.scala
 ##########
 @@ -272,24 +264,30 @@ class TemporalRowtimeJoin(
     * Binary search `rightRowsSorted` to find the latest right row to join 
with `leftTime`.
     * Latest means a right row with largest time that is still smaller or 
equal to `leftTime`.
     *
-    * @return index of such element. If such row was not found (either 
`rightRowsSorted` is empty
-    *         or all `rightRowsSorted` are are newer) return -1.
+    * @return found element or `Option.empty` If such row was not found 
(either `rightRowsSorted`
+    *         is empty or all `rightRowsSorted` are are newer).
     */
-  private def latestRightRowToJoin(rightRowsSorted: util.List[Row], leftTime: 
Long): Int = {
+  private def latestRightRowToJoin(rightRowsSorted: util.List[Row], leftTime: 
Long): Option[Row] = {
 
 Review comment:
   `Option` > `NullPointerException` :( Do not use nulls without working 
`@Nullable` annotations

----------------------------------------------------------------
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

Reply via email to