kunal642 commented on a change in pull request #4044: URL: https://github.com/apache/carbondata/pull/4044#discussion_r537236952
########## File path: core/src/main/java/org/apache/carbondata/core/util/CleanFilesUtil.java ########## @@ -163,8 +164,13 @@ private static void getStaleSegmentFiles(CarbonTable carbonTable, List<String> s } Set<String> loadNameSet = Arrays.stream(details).map(LoadMetadataDetails::getLoadName) .collect(Collectors.toSet()); - List<String> staleSegments = segmentFiles.stream().filter(segmentFile -> !loadNameSet.contains( - DataFileUtil.getSegmentNoFromSegmentFile(segmentFile))).collect(Collectors.toList()); + // get all stale segment files, not include compaction segments + List<String> staleSegments = segmentFiles.stream() + .filter(segmentFile -> !DataFileUtil.getSegmentNoFromSegmentFile(segmentFile).contains( + CarbonCommonConstants.POINT)) + .filter(segmentFile -> !loadNameSet.contains( Review comment: Please combine both filters into one ---------------------------------------------------------------- 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