alexandre-normand commented on code in PR #721:
URL: https://github.com/apache/iceberg-go/pull/721#discussion_r2850208052


##########
table/transaction.go:
##########
@@ -1212,6 +1282,117 @@ func (t *Transaction) rewriteSingleFile(ctx 
context.Context, fs io.IO, originalF
        return result, nil
 }
 
+// writePositionDeletesForFiles rewrites data files by preserving only rows 
that do NOT match the filter
+func (t *Transaction) writePositionDeletesForFiles(ctx context.Context, fs 
io.IO, updater *snapshotProducer, files []iceberg.DataFile, filter 
iceberg.BooleanExpression, caseSensitive bool, concurrency int) error {
+       posDeleteRecIter, err := t.makePositionDeleteRecordsForFilter(ctx, fs, 
files, filter, caseSensitive, concurrency)
+       if err != nil {
+               return err
+       }
+
+       partitionDataPerFile := make(map[string]map[int]any, len(files))
+       for _, df := range files {
+               partitionPath, _ := path.Split(df.FilePath())
+               partitionDataPerFile[partitionPath] = df.Partition()
+       }
+
+       posDeleteFiles := positionDeleteRecordsToDataFiles(ctx, 
t.tbl.Location(), t.meta, partitionDataPerFile, recordWritingArgs{

Review Comment:
   Thanks. Done in 6f24160aeca21c04978ed04ddbaf8deb52733442. 



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