Gabriel39 opened a new pull request, #66778:
URL: https://github.com/apache/doris/pull/66778

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Problem Summary:
   
   Iceberg V2 COUNT(*) pushdown treated the optional `total-records` snapshot 
summary field as an exact query result. A writer can provide a syntactically 
valid positive value that does not match the live data files, causing Doris to 
return a wrong count without reading data.
   
   This change derives an exact unfiltered count by summing the required 
`recordCount` values from all live data-file tasks. It falls back to the normal 
scan when the query has a row filter, any task has delete files or an invalid 
record count, or the sum overflows. The scan remains lazy and retains only one 
representative task, so FE memory use stays bounded.
   
   ### Release note
   
   Fix incorrect Iceberg V2 COUNT(*) results when snapshot summary row counts 
are inaccurate.
   
   ### Check List (For Author)
   
   - Test: Unit Test
     - `IcebergScanPlanProviderTest`: 148 tests passed
   - FE Checkstyle: passed with 0 violations
   - Behavior changed: Yes. Exact unfiltered COUNT(*) pushdown now uses live 
manifests and safely falls back when exactness cannot be proven.
   - Does this need documentation: No
   


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