lirui-apache opened a new issue, #8255:
URL: https://github.com/apache/iceberg/issues/8255

   ### Apache Iceberg version
   
   0.13.1
   
   ### Query engine
   
   None
   
   ### Please describe the bug 🐞
   
   When expiring snapshots, it seems we assume deleted files in expired 
snapshots can be safely removed, which may not be true. The following test 
would fail because the file is deleted, even though it's still referenced by a 
valid snapshot.
   ```java
     @Test
     public void test() throws Exception {
       File file = temp.newFile();
       Assert.assertTrue(file.exists());
       DataFile dataFile = DataFiles.builder(SPEC)
               .withPath(file.getAbsolutePath())
               .withFileSizeInBytes(10)
               .withPartitionPath("data_bucket=0")
               .withRecordCount(1)
               .withFormat("orc")
               .build();
       table.newAppend().appendFile(dataFile).commit();
       table.newDelete().deleteFile(dataFile).commit();
       table.newAppend().appendFile(dataFile).commit();
       List<Snapshot> snapshots = Lists.newArrayList(table.snapshots());
   
       
table.expireSnapshots().expireSnapshotId(snapshots.get(1).snapshotId()).commit();
   
       Assert.assertTrue(file.exists());
     }
   ```


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