shenjiayu17 commented on a change in pull request #3986: URL: https://github.com/apache/carbondata/pull/3986#discussion_r509947651
########## File path: processing/src/main/java/org/apache/carbondata/processing/merger/CarbonDataMergerUtil.java ########## @@ -1039,22 +1039,24 @@ private static boolean isSegmentValid(LoadMetadataDetails seg) { if (CompactionType.IUD_DELETE_DELTA == compactionTypeIUD) { int numberDeleteDeltaFilesThreshold = CarbonProperties.getInstance().getNoDeleteDeltaFilesThresholdForIUDCompaction(); - List<Segment> deleteSegments = new ArrayList<>(); - for (Segment seg : segments) { - if (checkDeleteDeltaFilesInSeg(seg, segmentUpdateStatusManager, - numberDeleteDeltaFilesThreshold)) { - deleteSegments.add(seg); + + // firstly find the valid segments which are updated from SegmentUpdateDetails, + // in order to reduce the segment list for behind traversal + List<String> segmentsPresentInSegmentUpdateDetails = new ArrayList<>(); Review comment: combined the `getDeleteDeltaFilesInSeg`and `checkDeleteDeltaFilesInSeg` , and kept the method name `checkDeleteDeltaFilesInSeg` and let it return `List<String>` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org