github-actions[bot] commented on code in PR #66913:
URL: https://github.com/apache/doris/pull/66913#discussion_r4056581156


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/source/IcebergScanNode.java:
##########
@@ -1773,20 +1900,11 @@ private Table useFrozenTableGeneration(Table 
currentTable) {
         if 
(snapshot.filter(IcebergMvccSnapshot.class::isInstance).isPresent()) {
             IcebergSnapshotCacheValue cacheValue =
                     ((IcebergMvccSnapshot) 
snapshot.get()).getSnapshotCacheValue();
+            frozenEnableMappingVarbinary = 
cacheValue.isEnableMappingVarbinary();

Review Comment:
   [P1] Keep system-table analysis on the frozen mapping policy
   
   `BindRelation` pins the source snapshot, and `IcebergSysExternalTable` 
resolves its synthetic metadata schema from that G1 table, but 
`loadSchemaCacheValue()` parses it using live catalog mapping flags. A reset 
can therefore analyze binary/timestamptz fields with G2 types while this 
changed scan path freezes and transports G1 flags, leaving the tuple schema 
inconsistent with execution. Please resolve the metadata table plus mapping 
options from the same pinned snapshot/generation and add a reset-barrier 
metadata-table test.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergExternalMetaCache.java:
##########
@@ -134,10 +148,49 @@ IcebergSnapshotEntryKey.class, 
IcebergSnapshotCacheValue.class, defaultEntryCach
 
     public Table getIcebergTable(ExternalTable dorisTable) {
         NameMapping nameMapping = dorisTable.getOrBuildNameMapping();
-        return 
tableEntry.get(nameMapping.getCtlId()).get(nameMapping).getIcebergTable();
+        IcebergTableCacheValue.Lease lease = statementLease(nameMapping);
+        if (lease != null) {
+            return lease.getIcebergTable();

Review Comment:
   [P1] Keep writer-schema conversion on this table generation
   
   `InsertUtils` pins a relation snapshot before 
`IcebergWriteSchemaContext.create()`, so this now returns G1 from the statement 
lease. That constructor still reads both mapping flags from the mutable live 
catalog after deriving G1 schema/spec/properties. An ALTER between the table 
read and those getters builds a writer context from G1 metadata under G2 
binary/timestamptz semantics, which drives sink columns and DEFAULT conversion. 
Please pass the mapping flags through `withIcebergTableGeneration()` (or an 
equivalent same-generation projection) and cover a G1-to-G2 reset barrier.



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