ldadima commented on code in PR #30215:
URL: https://github.com/apache/flink/pull/30215#discussion_r4765886088


##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/stream/asyncprocessing/state/JoinRecordAsyncStateViews.java:
##########
@@ -107,13 +104,12 @@ public StateFuture<List<OuterRecord>> findMatchedRecords(
                     .asyncValue()
                     .thenApply(
                             v -> {
-                                reusedList.clear();
-                                if (v != null) {
-                                    if (condition.apply(v)) {
-                                        reusedList.add(new OuterRecord(v));
-                                    }
+                                // the result records always not more than 1
+                                List<OuterRecord> matchedRecords = new 
ArrayList<>(1);

Review Comment:
   Done. The unique-key branches now return `Collections.emptyList() `on a miss 
and `Collections.singletonList(...)`on a match instead of allocating an 
ArrayList per lookup; the outer view returns the list directly from thenApply. 
Callers only read the returned records, so the immutable lists are safe. 
Verified with the focused unit tests and with JoinITCase against the async 
ForSt backend.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to