Gabriel39 commented on code in PR #70321:
URL: https://github.com/apache/doris/pull/70321#discussion_r4489357851


##########
fe/fe-connector/fe-connector-iceberg/src/main/java/org/apache/doris/connector/iceberg/IcebergScanPlanProvider.java:
##########
@@ -1792,8 +1802,12 @@ private static OptionalLong 
livePositionDeleteRowCount(Table table, Snapshot sna
             try (ManifestReader<DeleteFile> reader = 
ManifestFiles.readDeleteManifest(
                     manifest, table.io(), table.specs())) {
                 for (DeleteFile delete : reader) {
-                    if (delete.keyMetadata() != null || delete.content() != 
FileContent.POSITION_DELETES
-                            || delete.recordCount() < 0) {
+                    // Netting delete counts happens before file-task 
planning. Keep the same early
+                    // encryption rejection here so COUNT cannot escape 
through the manifest shortcut.
+                    if (delete.keyMetadata() != null) {

Review Comment:
   Fixed in d781ffb4353186e5c3b9d9695a9922c1d9dc8cbc.
   
   `canServeMetadataOnlyCount()` now returns `false` for file-level encrypted 
data or deletes. Only the execution-specific `EncryptedCountException` is 
translated by the boolean probe; execution-time rejection and unrelated 
metadata errors still propagate as before. After checking row counters, the 
probe streams `key_metadata` from every live data-manifest entry rather than 
inferring plaintext from aggregate counters. It never opens payload files or 
retains a file-task list, and readers close on early return.
   
   Added nine SDK-backed regression cases for independent data/delete 
encryption, position/equality deletes, both dangling-delete settings, empty 
tables, pinned snapshots and removed encrypted entries. Seven failed before 
this fix; all nine pass afterward. The wider Iceberg connector run passed 1,886 
tests with zero failures/errors and 10 existing skips; FE Checkstyle also 
passed. The PR description includes the verification and the additional 
manifest-entry inspection cost.



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