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


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergConnectorMetadata.java:
##########
@@ -797,7 +797,7 @@ private Table resolveTableForRead(ConnectorSession session, 
IcebergTableHandle h
                             value -> 
IcebergConnector.cachedTableCleanup(value, catalogProps.getFlavor()));
         }
         IcebergEncryptionRead.check(table, catalogProps, context);
-        return table;
+        return IcebergSnapshotTableOperations.v4ReadTable(table);

Review Comment:
   [P1] Apply the V4 read view to metadata-delete candidate planning. 
`deleteUsingMetadata` receives a raw table from `catalogOps.withTable`; its 
separate `wrapTableForScan` only adds authentication, so `hasLiveDeleteFiles` 
and `matchesWholeFilesOnly` read V4 manifests with raw SDK IO before 
`openTransaction`. A valid format-v4 table with relative manifest/list 
locations can therefore throw a missing-file error, and the outer catch returns 
`Failed to metadata-delete...` instead of committing the whole-file delete or 
returning the normal row-level fallback. Wrap only the read-side candidate 
table with `IcebergSnapshotTableOperations.v4ReadTable`, retaining the raw 
table for the writable transaction, or explicitly gate and safely fall back for 
V4.



##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergScanPlanProvider.java:
##########
@@ -2204,6 +2205,46 @@ private static TFileFormatType 
deleteFileFormat(FileFormat format) {
         return null;
     }
 
+    /** Resolve table-relative physical locations before storage-scheme 
normalization. */
+    private UnaryOperator<String> newUriNormalizer(Table table, Map<String, 
String> vendedToken) {
+        UnaryOperator<String> normalize = newUriNormalizer(vendedToken);
+        // Metadata-table properties omit the format version; native 
delete-table ranges use the base version.
+        Table base = table instanceof BaseMetadataTable ? ((BaseMetadataTable) 
table).table() : table;

Review Comment:
   [P1] Reuse the bound V4 resolver through authentication decorators. 
`wrapTableForScan` first binds the V4 read view and then wraps its IO in 
`IcebergAuthenticatedFileIO`, so `newUriNormalizer` sees a decorator and 
constructs a second `IcebergV4FileIO` here. For an upgraded V2/V3 table whose 
Avro manifest is under scheme-less absolute 
`write.metadata.path=/metadata/...`, the outer adapter's producing-version 
probe delegates `newInputFile(String)` through the inner V4 adapter, which 
treats `/metadata/...` as relative and opens `table.location()//metadata/...`. 
Cold native planning fails before it can classify the legacy data path. 
Unwrap/reuse the existing resolver and add a cold Kerberos upgrade case.



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