hutiefang76 opened a new issue, #4405:
URL: https://github.com/apache/amoro/issues/4405

   ### What happened?
   
   The snapshot descriptor reports total file count and total records, but 
calculates file size as added bytes plus removed bytes. After appending a 
200-byte file to a table containing a 100-byte file, it reports 200 bytes 
rather than 300. Deleting the 100-byte file then reports 100 bytes rather than 
the remaining 200. Reading the total size would make these statistics 
consistent with one another and with the other format descriptors.
   
   ### Affects Versions
   
   Reproduced on master at `9442f8c`. Released versions have not been checked.
   
   ### What table formats are you seeing the problem on?
   
   Iceberg
   
   ### What engines are you seeing the problem on?
   
   AMS
   
   ### How to reproduce
   
   1. Create an unpartitioned Iceberg table and append a data file with 
declared size 100 bytes.
   2. Append another data file with declared size 200 bytes.
   3. Read the snapshots through `MixedAndIcebergTableDescriptor.getSnapshots`: 
the second snapshot reports 200 bytes, although it contains two files totaling 
300 bytes.
   4. Delete the first data file and read the new snapshot: it reports 100 
bytes, although the remaining file is 200 bytes.
   
   The regression test reproduces this using actual Iceberg commits through 
`HadoopTables`; the data files are metadata fixtures.
   
   ### Relevant log output
   
   `expected: <300> but was: <200>` after the second append; `expected: <200> 
but was: <100>` after deletion.
   
   ### Anything else
   
   Proposed fix: Read `SnapshotSummary.TOTAL_FILE_SIZE_PROP` for snapshot file 
size. Add append, delete and empty-table regression tests using a temporary 
Iceberg table.
   
   Code was assisted by DeepSeek v4 Flash via Reasonix 1.39.4; submission text 
was assisted by Codex. The patch and local test results were reviewed.
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of Conduct
   


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

Reply via email to