xuyangzhong commented on code in PR #25217: URL: https://github.com/apache/flink/pull/25217#discussion_r1724169227
########## 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: Got it! -- 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