JingsongLi commented on code in PR #11355:
URL: https://github.com/apache/paimon/pull/11355#discussion_r4662522042


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/FileStoreLookupFunction.java:
##########
@@ -343,6 +343,10 @@ public Collection<RowData> lookup(RowData keyRow) {
             if (partitionLoader == null) {
                 return lookupInternal(key);
             }
+            // An empty selection must not keep serving a previously loaded 
partition.
+            if (partitionLoader.partitions().isEmpty()) {
+                return Collections.emptyList();
+            }
             List<BinaryRow> partitions =

Review Comment:
   **[P2] Keep the pre-drop cache invalid after the selection becomes empty.** 
I extended the existing real-table regression with a check on the first lookup 
after recreating `pt=1`. The join returned no matches after the truncate, but 
the first lookup after writing `(1, 2, 4)` then returned the deleted value `3` 
in both async `FULL` and async `MEMORY` modes. The partition loader becomes 
nonempty and schedules a rebuild, while `currentPartitions()` still refers to 
the pre-truncate cache. Preserve the empty lookup state until a cache built 
after that empty selection is installed. The existing test waits for `4`, which 
misses this interval.



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