924060929 commented on code in PR #66345:
URL: https://github.com/apache/doris/pull/66345#discussion_r3710248361


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergScanPlanProvider.java:
##########
@@ -1137,6 +1169,18 @@ private static boolean 
supportsSnapshotSelection(IcebergTableHandle handle) {
                 && type != MetadataTableType.ALL_ENTRIES;
     }
 
+    /** Metadata tables whose rows describe table metadata rather than files 
reachable from a data snapshot. */
+    private static boolean isSnapshotIndependentSystemTable(IcebergTableHandle 
handle) {
+        if (!handle.isSystemTable()) {
+            return false;
+        }
+        MetadataTableType type = 
MetadataTableType.from(handle.getSysTableName());
+        return type == MetadataTableType.HISTORY
+                || type == MetadataTableType.SNAPSHOTS
+                || type == MetadataTableType.REFS
+                || type == MetadataTableType.METADATA_LOG_ENTRIES;

Review Comment:
   [P1] Keep the resolved-empty fence for `$snapshots`, `$history`, and 
`$refs`. Unlike `$metadata_log_entries`, which has a creation metadata row 
before the first data snapshot, these three are empty at the resolved S0 
generation and gain rows only after the first append. A production mismatch is 
reachable when `latestSnapshotCache` returns a cached `-1` without populating 
the statement scope while REST vended credentials disable `tableCache`: after 
an external first append, this exemption lets `resolveSysTable()` load live S1, 
so the base-table scan remains empty but `$snapshots`/`$history`/`$refs` expose 
S1. That contradicts this handle path’s query-begin/time-travel pin contract. 
Please restrict the exemption to `METADATA_LOG_ENTRIES` (or carry the frozen 
base-metadata generation) and add first-append tests for all three tables.



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


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

Reply via email to