LuciferYang commented on code in PR #10924:
URL: https://github.com/apache/paimon/pull/10924#discussion_r4439180177


##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lookup/LookupCompactDiffRead.java:
##########
@@ -45,6 +45,9 @@ public class LookupCompactDiffRead extends 
AbstractDataTableRead {
     public LookupCompactDiffRead(MergeFileSplitRead mergeRead, TableSchema 
schema) {
         super(schema);
         this.incrementalDiffRead = new 
IncrementalCompactDiffSplitRead(mergeRead);
+        // deleted rows must reach the lookup cache as DELETE records, both 
when compaction keeps
+        // the delete record and when it drops the row and the row is only in 
the files before
+        this.incrementalDiffRead.forceKeepDelete();

Review Comment:
   Reproduced with your setup. Fixed in 56aeed421a: the DELETE branch of 
`SecondaryIndexLookupTable` now retracts the secondary key of the cached row, 
the same way the INSERT branch does.
   
   `LookupJoinITCase#testLookupJoinBySecondaryKeyAfterKeyOnlyDelete` covers the 
delete and reinsert with a changed secondary key for the full and memory 
caches, and checks that the delete record stays in an intermediate level. On 
the previous head it fails at the old-key lookup after the reinsert. 
`LookupTableTest#testSecKeyTableDeleteWithoutSecKey` covers the same sequence 
on the lookup table directly.
   



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