lincoln-lil commented on code in PR #25217:
URL: https://github.com/apache/flink/pull/25217#discussion_r1723515590


##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/utils/UpsertKeyUtil.java:
##########
@@ -42,8 +43,17 @@ public class UpsertKeyUtil {
      */
     @Nonnull
     public static int[] getSmallestKey(@Nullable Set<ImmutableBitSet> 
upsertKeys) {
+        return smallestKey(upsertKeys).orElse(new int[0]);
+    }
+
+    /**
+     * Returns the smallest key of given upsert keys wrapped with a java 
{@link Optional}. Different
+     * from {@link #getSmallestKey(Set)}, it'll return result with an empty 
{@link Optional} if the
+     * input set is null or empty.
+     */
+    public static Optional<int[]> smallestKey(@Nullable Set<ImmutableBitSet> 
upsertKeys) {

Review Comment:
   Well, I checked pr, and in StreamExecLookupJoin, I still used a habitual 
double-check on int[]...  :-(
   `inputUpsertKey.length == 0` seems like an overkill to the guard but doesn't 
cause any problems, so just keep it as it is?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to