wwj6591812 commented on code in PR #4903:
URL: https://github.com/apache/paimon/pull/4903#discussion_r1919614202


##########
paimon-core/src/main/java/org/apache/paimon/operation/FileDeletionBase.java:
##########
@@ -259,12 +267,17 @@ public void deleteAddedDataFiles(String manifestListName) 
{
 
     private void deleteAddedDataFiles(List<ExpireFileEntry> manifestEntries) {
         List<Path> dataFileToDelete = new ArrayList<>();
+        Map<Pair<BinaryRow, Integer>, DataFilePathFactory> 
dataFilePathFactoryMap = new HashMap<>();

Review Comment:
   Extract a common util method?
   These logic code has appeared multi times.



##########
paimon-core/src/main/java/org/apache/paimon/operation/FileDeletionBase.java:
##########
@@ -216,17 +217,24 @@ protected void getDataFileToDelete(
             List<ExpireFileEntry> dataFileEntries) {
         // we cannot delete a data file directly when we meet a DELETE entry, 
because that
         // file might be upgraded
+        Map<Pair<BinaryRow, Integer>, DataFilePathFactory> 
dataFilePathFactoryMap = new HashMap<>();
         for (ExpireFileEntry entry : dataFileEntries) {
-            Path bucketPath = pathFactory.bucketPath(entry.partition(), 
entry.bucket());
-            Path dataFilePath = new Path(bucketPath, entry.fileName());
+            Pair<BinaryRow, Integer> bucket = Pair.of(entry.partition(), 
entry.bucket());
+            DataFilePathFactory dataFilePathFactory =
+                    dataFilePathFactoryMap.computeIfAbsent(
+                            bucket,

Review Comment:
   I think `bucket -> partitionAndBucket` is better?



-- 
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: issues-unsubscr...@paimon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to