kunal642 commented on a change in pull request #3834:
URL: https://github.com/apache/carbondata/pull/3834#discussion_r484549160



##########
File path: 
hadoop/src/main/java/org/apache/carbondata/hadoop/api/CarbonFileInputFormat.java
##########
@@ -239,6 +255,61 @@ public void 
setAllColumnProjectionIfNotConfigured(JobContext job, CarbonTable ca
     List<CarbonInputSplit> dataBlocksOfSegment = getDataBlocksOfSegment(job, 
carbonTable,
         indexFilter, validSegments, new ArrayList<>(), new ArrayList<>());
     numBlocks = dataBlocksOfSegment.size();
+    List<String> allDeleteDeltaFiles = 
getAllDeleteDeltaFiles(carbonTable.getTablePath());
+    if (CollectionUtils.isNotEmpty(allDeleteDeltaFiles)) {
+      for (CarbonInputSplit split : dataBlocksOfSegment) {
+        split.setDeleteDeltaFiles(getDeleteDeltaFiles(split.getFilePath(), 
allDeleteDeltaFiles));
+      }
+    }
     return new LinkedList<>(dataBlocksOfSegment);
   }
+
+  private List<String> getAllDeleteDeltaFiles(String path) {
+    List<String> deltaFiles = null;
+    try (Stream<Path> walk = Files.walk(Paths.get(path))) {
+      deltaFiles = walk.map(x -> x.toString())
+          .filter(f -> f.endsWith(CarbonCommonConstants.DELETE_DELTA_FILE_EXT))
+          .collect(Collectors.toList());
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
+    return deltaFiles;
+  }
+
+  private String[] getDeleteDeltaFiles(String segmentPath, List<String> 
allDeleteDeltaFiles) {

Review comment:
       change variable name from segmentPath to tablePath




----------------------------------------------------------------
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:
[email protected]


Reply via email to