This is an automated email from the ASF dual-hosted git repository.

suxiaogang223 pushed a commit to branch fix-paimon-compaction-opensource-263
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 4a00013b0fe76ffd30a57752e54b5dcea7371fa7
Author: Socrates <[email protected]>
AuthorDate: Tue May 19 18:03:28 2026 +0800

    [fix](paimon) Pin snapshot ID for Paimon external table queries to avoid 
compaction issues
    
    Doris previously used an unpinned Paimon table handle for normal queries, 
relying on the Paimon SDK to discover the latest snapshot. This could lead to 
empty results if a compaction occurred during the query, as the SDK might fail 
to resolve the new snapshot correctly.
    
    This change modifies PaimonExternalTable to always use the pinned table 
from the snapshot cache, ensuring consistency across all query types (Normal, 
MTMV, and MVCC).
    
    Jira: OPENSOURCE-263
---
 .../org/apache/doris/datasource/paimon/PaimonExternalTable.java   | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalTable.java
 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalTable.java
index 78639761ede..0acefcc46c7 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalTable.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonExternalTable.java
@@ -97,13 +97,7 @@ public class PaimonExternalTable extends ExternalTable 
implements MTMVRelatedTab
     }
 
     public Table getPaimonTable(Optional<MvccSnapshot> snapshot) {
-        if (snapshot.isPresent()) {
-            // MTMV scenario: get from snapshot cache
-            return 
getOrFetchSnapshotCacheValue(snapshot).getSnapshot().getTable();
-        } else {
-            // Normal query scenario: get directly from table cache
-            return PaimonUtils.getPaimonTable(this);
-        }
+        return getOrFetchSnapshotCacheValue(snapshot).getSnapshot().getTable();
     }
 
     private PaimonSnapshotCacheValue 
getPaimonSnapshotCacheValue(Optional<TableSnapshot> tableSnapshot,


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to