zinking opened a new issue, #5307:
URL: https://github.com/apache/iceberg/issues/5307

   
   when purging data, it is hoped that the delete should go through metadata 
delete instead of  `replaceData` plan.
   
   for example if my table went through partition evolutions:
   1. ts
   2. ts, name
   3. ts, year, name
   
   ideally if I write delete statements like `delete from table where ts < 
2022`, metadata deletes should still work. 
   but currently it is restricted.
   
   ```
   
     public boolean canDeleteWhere(Filter[] filters) {
       Preconditions.checkArgument(
           snapshotId == null,
           "Cannot delete from table at a specific snapshot: %s", snapshotId);
   
   // this is preventing delete going through metadata delete
       if (table().specs().size() > 1) {
         // cannot guarantee a metadata delete will be successful if we have 
multiple specs
         return false;
       }
   
       Set<Integer> identitySourceIds = table().spec().identitySourceIds();
       Schema schema = table().schema();
   
       for (Filter filter : filters) {
         // return false if the filter requires rewrite or if we cannot 
translate the filter
         if (requiresRewrite(filter, schema, identitySourceIds) || 
SparkFilters.convert(filter) == null) {
           return false;
         }
       }
   
       return true;
     }
   
   ```


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